/** * Removes this child from the structure. * @return the parent builder */ public ParentBuilder remove() { removeAllChildren(); Set<FullNode> siblings = getSiblings(); FullNode myBlueprint = blueprints.remove(myPath); siblings.remove(myBlueprint); return parentBuilder; }
/** * Removes this child from the structure. * @return the parent builder */ public ParentBuilder remove() { removeAllChildren(); Set<FullNode> siblings = getSiblings(); FullNode myBlueprint = blueprints.remove(myPath); siblings.remove(myBlueprint); return parentBuilder; }
@Override void doReplace(Entity.Blueprint blueprint, Object attachment) { Set<FullNode> siblings = getSiblings(); FullNode myBlueprint = blueprints.remove(myPath); siblings.remove(myBlueprint); FullNode myNode = new FullNode(blueprint, attachment); siblings.add(myNode); children.remove(myPath); myPath = parentBuilder.myPath.modified().extend(Blueprint.getSegmentTypeOf(blueprint), blueprint.getId()) .get(); blueprints.put(myPath, myNode); }
@Override void doReplace(Entity.Blueprint blueprint, Object attachment) { Set<FullNode> siblings = getSiblings(); FullNode myBlueprint = blueprints.remove(myPath); siblings.remove(myBlueprint); FullNode myNode = new FullNode(blueprint, attachment); siblings.add(myNode); children.remove(myPath); myPath = parentBuilder.myPath.modified().extend(Blueprint.getSegmentTypeOf(blueprint), blueprint.getId()) .get(); blueprints.put(myPath, myNode); }