/** * Creates a root node for the given tree as the one {@link PostOrderDiffWalk} should use to * start the traversal */ private static NodeRef nodeFor(RevTree root) { Envelope bounds = SpatialOps.boundsOf(root); return NodeRef.createRoot( Node.create(NodeRef.ROOT, root.getId(), ObjectId.NULL, TYPE.TREE, bounds)); }
/** * Creates a root node for the given tree as the one {@link PreOrderDiffWalk} should use to * start the traversal */ private NodeRef nodeFor(RevTree root) { Envelope bounds = SpatialOps.boundsOf(root); return NodeRef.createRoot( Node.create(NodeRef.ROOT, root.getId(), ObjectId.NULL, TYPE.TREE, bounds)); }
Node rnode = Node.create(NodeRef.ROOT, right.getId(), metadataId, TYPE.TREE, rbounds); NodeRef leftRef = NodeRef.createRoot(lnode); NodeRef rightRef = NodeRef.createRoot(rnode);
metadataId, TYPE.TREE, rbounds, null); NodeRef leftRef = NodeRef.createRoot(lnode); NodeRef rightRef = NodeRef.createRoot(rnode);
/** * Creates a root node for the given tree as the one {@link PreOrderDiffWalk} should use to * start the traversal */ private NodeRef nodeFor(RevTree root) { Envelope bounds = SpatialOps.boundsOf(root); return NodeRef.createRoot(RevObjectFactory.defaultInstance().createNode(NodeRef.ROOT, root.getId(), ObjectId.NULL, TYPE.TREE, bounds, null)); }
/** * Creates a root node for the given tree as the one {@link PreOrderDiffWalk} should use to * start the traversal */ private NodeRef nodeFor(RevTree root) { Envelope bounds = SpatialOps.boundsOf(root); return NodeRef.createRoot(RevObjectFactory.defaultInstance().createNode(NodeRef.ROOT, root.getId(), ObjectId.NULL, TYPE.TREE, bounds, null)); }
/** * Creates a root node for the given tree as the one {@link PostOrderDiffWalk} should use to * start the traversal */ private static NodeRef nodeFor(RevTree root) { Envelope bounds = SpatialOps.boundsOf(root); return NodeRef.createRoot(RevObjectFactory.defaultInstance().createNode(NodeRef.ROOT, root.getId(), ObjectId.NULL, TYPE.TREE, bounds, null)); }
@Test public void testCreateRoot() { Node node = RevObjectFactory.defaultInstance().createNode(NodeRef.ROOT, ObjectId.valueOf("abc123000000000000001234567890abcdef0000"), ObjectId.NULL, TYPE.FEATURE, null, null); NodeRef root = NodeRef.createRoot(node); assertEquals(node, root.getNode()); Node node2 = RevObjectFactory.defaultInstance().createNode("nonRootPath", ObjectId.valueOf("abc123000000000000001234567890abcdef0000"), ObjectId.NULL, TYPE.FEATURE, null, null); exception.expect(IllegalArgumentException.class); NodeRef.createRoot(node2); }
@Test public void testHashCode() { Node node = RevObjectFactory.defaultInstance().createNode("Points.1", ObjectId.valueOf("abc123000000000000001234567890abcdef0000"), ObjectId.NULL, TYPE.FEATURE, null, null); NodeRef nodeRef = NodeRef.create("Points", node); Node node2 = RevObjectFactory.defaultInstance().createNode("Lines.1", ObjectId.valueOf("abc123000000000000001234567890abcdef0001"), ObjectId.NULL, TYPE.FEATURE, null, null); NodeRef nodeRef2 = new NodeRef(node2, "Lines", ObjectId.NULL); assertNotSame(nodeRef.hashCode(), nodeRef2.hashCode()); Node node3 = RevObjectFactory.defaultInstance().createNode(NodeRef.ROOT, ObjectId.valueOf("abc123000000000000001234567890abcdef0000"), ObjectId.NULL, TYPE.FEATURE, null, null); NodeRef root = NodeRef.createRoot(node3); root.hashCode(); }