/** * Creates a new {@code NodeRef} with the updated {@link ObjectId} and {@link Envelope}. * * @param newId the updated {@link ObjectId} * @param newBounds the updated bounds * @return the newly created {@code NodeRef} */ public NodeRef update(final ObjectId newId, final @Nullable Envelope newBounds) { Node newNode = node.update(newId, newBounds); return NodeRef.create(parentPath, newNode, metadataId); }
/** * Creates a new {@code NodeRef} with the updated {@link ObjectId} and {@link Envelope}. * * @param newId the updated {@link ObjectId} * @param newBounds the updated bounds * @return the newly created {@code NodeRef} */ public NodeRef update(final ObjectId newId, final @Nullable Envelope newBounds) { Node newNode = node.update(newId, newBounds); return NodeRef.create(parentPath, newNode, metadataId); }
public Node update(final ObjectId newId) { return update(newId, bounds().orNull()); }
public Node update(final ObjectId newId) { return update(newId, bounds().orNull()); }
public boolean remove(Node node) { if (!node.getObjectId().isNull()) { node = node.update(ObjectId.NULL); } int delta = put(node); return -1 == delta; }
public boolean remove(Node node) { if (!node.getObjectId().isNull()) { node = node.update(ObjectId.NULL); } int delta = put(node); return -1 == delta; }
Envelope newBounds = new Envelope(n.bounds().get()); newBounds.translate(0.1, 0.1); Node c = n.update(newId, newBounds); expectedChanges.put(n, c); newNodes.add(c);
Envelope newBounds = new Envelope(n.bounds().get()); newBounds.translate(0.1, 0.1); Node c = n.update(newId, newBounds); expectedChanges.put(n, c); newNodes.add(c);
public RevTree build(ObjectStore store) { final ObjectId treeId = this.node.getObjectId(); final RevTree original = EMPTY_TREE_ID.equals(treeId) ? EMPTY : store.getTree(treeId); RevTreeBuilder builder = RevTreeBuilder.builder(store, original); ImmutableList<Node> currentTrees = original.trees(); currentTrees.forEach(builder::remove); for (MutableTree childTree : this.childTrees.values()) { childTree.build(store); Node newNode = childTree.node; builder.put(newNode); } final Node oldNode = this.node; RevTree newTree = builder.build(); Envelope newBounds = SpatialOps.boundsOf(newTree); Node newNode = oldNode.update(newTree.getId(), newBounds); this.node = newNode; return newTree; }
public RevTree build(ObjectStore store) { final ObjectId treeId = this.node.getObjectId(); final RevTree original = EMPTY_TREE_ID.equals(treeId) ? EMPTY : store.getTree(treeId); CanonicalTreeBuilder builder = CanonicalTreeBuilder.create(store, original);// .clearSubtrees(); ImmutableList<Node> currentTrees = original.trees(); currentTrees.forEach((n) -> builder.remove(n.getName())); for (MutableTree childTree : this.childTrees.values()) { childTree.build(store); Node newNode = childTree.node; builder.put(newNode); } final Node oldNode = this.node; RevTree newTree = builder.build(); Envelope newBounds = SpatialOps.boundsOf(newTree); Node newNode = oldNode.update(newTree.getId(), newBounds); this.node = newNode; return newTree; }
newBounds.translate(0.1, 0.1); Node newNode = oldNode.update(newId, newBounds); builder.update(oldNode, newNode); removedNodes.add(oldNode);
Node update = oldNode.update(newId, newBounds);
Node update = oldNode.update(newId, newBounds);
newBounds.translate(0.1, 0.1); Node newNode = oldNode.update(newId, newBounds); builder.update(oldNode, newNode); removedNodes.add(oldNode);
objectStore.put(updatedFeature); Node update = n.update(updatedFeature.getId(), newBounds); changedNodes.add(update); builder.put(update);
objectStore.put(updatedFeature); Node update = n.update(updatedFeature.getId(), newBounds); changedNodes.add(update); builder.put(update);
TYPE.FEATURE, null, null); Node updated = node.update(oId2); assertEquals(oId1, node.getObjectId()); assertEquals(oId2, updated.getObjectId()); updated = node.update(oId2); assertEquals(oId1, node.getObjectId()); assertEquals(oId2, updated.getObjectId()); null, null); updated = node.update(oId2); assertEquals(oId1, node.getObjectId()); assertEquals(oId2, updated.getObjectId());