/** * Traverses the tree depth-first, invoking callback methods of the processor when * passing through the nodes. */ public void traverse(PrefetchProcessor processor) { boolean result = false; if (isPhantom()) { result = processor.startPhantomPrefetch(this); } else if (isDisjointPrefetch()) { result = processor.startDisjointPrefetch(this); } else if (isJointPrefetch()) { result = processor.startJointPrefetch(this); } else { result = processor.startUnknownPrefetch(this); } // process children unless processing is blocked... if (result && children != null) { Iterator it = children.iterator(); while (it.hasNext()) { ((PrefetchTreeNode) it.next()).traverse(processor); } } // call finish regardless of whether children were processed processor.finishPrefetch(this); }
PrefetchProcessorNode processorNode = (PrefetchProcessorNode) node; if (node.getParent().isPhantom()) {
private PrefetchTreeNode cloneJointSubtree(PrefetchTreeNode parent) { PrefetchTreeNode cloned = new PrefetchTreeNode(parent, getName()); if (parent != null) { cloned.setSemantics(getSemantics()); cloned.setPhantom(isPhantom()); } if (children != null) { for (PrefetchTreeNode child : children) { if (child.isJointPrefetch()) { cloned.addChild(child.cloneJointSubtree(cloned)); } } } return cloned; }
&& !getParent().isPhantom() && getIncoming() != null && !getIncoming().isFlattened()) {
void merge(PrefetchTreeNode original, PrefetchTreeNode toMerge) { if (toMerge.getSemantics() != UNDEFINED_SEMANTICS) { original.setSemantics(toMerge.getSemantics()); } if (!toMerge.isPhantom()) { original.setPhantom(false); } for (PrefetchTreeNode childToMerge : toMerge.getChildren()) { PrefetchTreeNode childOrigin = original.getChild(childToMerge.getName()); if (childOrigin == null) { childOrigin = original.addPath(childToMerge.getName()); } merge(childOrigin, childToMerge); } }
private PrefetchTreeNode deepClone(PrefetchTreeNode source, PrefetchTreeNode targetParent) { PrefetchTreeNode target = new PrefetchTreeNode(targetParent, source.getName()); target.setEjbqlPathEntityId(source.getEjbqlPathEntityId()); target.setEntityName(source.getEntityName()); target.setPhantom(source.isPhantom()); target.setSemantics(source.getSemantics()); for (PrefetchTreeNode child : source.getChildren()) { target.addChild(deepClone(child, target)); } return target; }
/** * Traverses the tree depth-first, invoking callback methods of the * processor when passing through the nodes. */ public void traverse(PrefetchProcessor processor) { boolean result = false; if (isPhantom()) { result = processor.startPhantomPrefetch(this); } else if (isDisjointPrefetch()) { result = processor.startDisjointPrefetch(this); } else if (isDisjointByIdPrefetch()) { result = processor.startDisjointByIdPrefetch(this); } else if (isJointPrefetch()) { result = processor.startJointPrefetch(this); } else { result = processor.startUnknownPrefetch(this); } // process children unless processing is blocked... if (result && children != null) { for (PrefetchTreeNode child : children) { child.traverse(processor); } } // call finish regardless of whether children were processed processor.finishPrefetch(this); }
&& !getParent().isPhantom() && getIncoming() != null && !getIncoming().getRelationship().isFlattened()) {
@Override public void writeTo(Output output, PrefetchTreeNode message) throws IOException { if (message.getName() != null) { output.writeString(1, message.getName(), false); } output.writeBool(2, message.isPhantom(), false); output.writeInt32(3, message.getSemantics(), false); if (message.getEjbqlPathEntityId() != null) { output.writeString(4, message.getEjbqlPathEntityId(), false); } if (message.getEntityName() != null) { output.writeString(5, message.getEntityName(), false); } if (message.hasChildren()) { for (PrefetchTreeNode node : message.getChildren()) { output.writeObject(6, node, this, true); } } }
if (node.getParent() == null || node.getParent().isPhantom()) { node.setParentAttachmentStrategy(new NoopParentAttachmentStrategy()); } else if (node.isJointPrefetch()) {