public final InternalNode<K, V> getChild(Object childName) { return delegate.getChild(childName); }
public final InternalNode<K, V> getChild(Fqn f) { return delegate.getChild(f); }
public InternalNode peekInternalNode(Fqn fqn, boolean includeInvalidNodes) { if (fqn == null || fqn.size() == 0) return rootInternal; InternalNode n = rootInternal; int fqnSize = fqn.size(); for (int i = 0; i < fqnSize; i++) { Object obj = fqn.get(i); n = n.getChild(obj); if (n == null) { return null; } else if (!includeInvalidNodes && !n.isValid()) { return null; } } return n; }
public InternalNode[] peekInternalNodeAndDirectParent(Fqn fqn, boolean includeInvalidNodes) { if (fqn == null || fqn.size() == 0) return new InternalNode[]{rootInternal, null}; InternalNode n = rootInternal; InternalNode directParent = null; int fqnSize = fqn.size(); for (int i = 0; i < fqnSize; i++) { directParent = n; Object obj = fqn.get(i); n = directParent.getChild(obj); if (n == null) { return NULL_ARRAY; } else if (!includeInvalidNodes && !n.isValid()) { return NULL_ARRAY; } } return new InternalNode[]{n, directParent}; }
@Override public InternalNode<K, V> getChild(Fqn f) { if (fqn.size() == 1) { return getChild(fqn.getLastElement()); } else { InternalNode<K, V> currentNode = this; for (int i = 0; i < fqn.size(); i++) { Object nextChildName = fqn.get(i); currentNode = currentNode.getChild(nextChildName); if (currentNode == null) return null; } return currentNode; } }
InternalNode ancestor = cache.getNode(ancFqn).getDelegationTarget(); Object name = descFqn.get(ancFqn.size()); InternalNode child = ancestor.getChild(name); if (ancFqn.size() == descFqn.size() + 1)