public void removeAll(Set<DestinationNode> answer, String[] paths, int startIndex) { DestinationNode node = this; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (path.equals(ANY_DESCENDENT)) { answer.addAll(node.removeDesendentValues()); break; } // TODO is this correct, we are appending wildcard values here??? node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { // node = node.getAnyChildNode(); node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.removeValues()); } }
public void appendDescendantValues(Set answer) { Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); child.appendDescendantValues(answer); } }
public Collection getDesendentValues() { Collection answer = new ArrayList(); Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); answer.addAll(child.getDesendentValues()); } return answer; }
public void appendMatchingValues(Set<DestinationNode> answer, String[] paths, int startIndex, boolean deep) { DestinationNode node = this; boolean couldMatchAny = true; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (deep && path.equals(ANY_DESCENDENT)) { answer.addAll(node.getDesendentValues()); couldMatchAny = false; break; } node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.getValues()); if (couldMatchAny) { // lets allow FOO.BAR to match the FOO.BAR.> entry in the map DestinationNode child = node.getChild(ANY_DESCENDENT); if (child != null) { answer.addAll(child.getValues()); } } } }
public Collection removeValues() { Collection answer = new ArrayList(); Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); answer.addAll(child.removeValues()); } return answer; }
public void removeAll(Set<DestinationNode> answer, String[] paths, int startIndex) { DestinationNode node = this; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (path.equals(ANY_DESCENDENT)) { answer.addAll(node.removeDesendentValues()); break; } // TODO is this correct, we are appending wildcard values here??? node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { // node = node.getAnyChildNode(); node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.removeValues()); } }
public void appendMatchingWildcards(Set answer, String[] paths, int startIndex) { Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); child.appendMatchingWildcards(answer, paths, startIndex); } }
public void removeAll(Set<DestinationNode> answer, String[] paths, int startIndex) { DestinationNode node = this; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (path.equals(ANY_DESCENDENT)) { answer.addAll(node.removeDesendentValues()); break; } // TODO is this correct, we are appending wildcard values here??? node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { // node = node.getAnyChildNode(); node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.removeValues()); } }
public Collection getValues() { Collection answer = new ArrayList(); Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); answer.addAll(child.getValues()); } return answer; }
public void removeAll(Set<DestinationNode> answer, String[] paths, int startIndex) { DestinationNode node = this; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (path.equals(ANY_DESCENDENT)) { answer.addAll(node.removeDesendentValues()); break; } // TODO is this correct, we are appending wildcard values here??? node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { // node = node.getAnyChildNode(); node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.removeValues()); } }
public Collection getChildren() { Collection answer = new ArrayList(); Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); answer.addAll(child.getChildren()); } return answer; }
public void removeAll(Set answer, String[] paths, int startIndex) { DestinationNode node = this; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (path.equals(ANY_DESCENDENT)) { answer.addAll(node.removeDesendentValues()); break; } node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { // node = node.getAnyChildNode(); node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.removeValues()); } }
public void appendMatchingValues(Set answer, String[] paths, int startIndex) { Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); child.appendMatchingValues(answer, paths, startIndex); } }
public void appendMatchingValues(Set<DestinationNode> answer, String[] paths, int startIndex, boolean deep) { DestinationNode node = this; boolean couldMatchAny = true; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (deep && path.equals(ANY_DESCENDENT)) { answer.addAll(node.getDesendentValues()); couldMatchAny = false; break; } node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.getValues()); if (couldMatchAny) { // lets allow FOO.BAR to match the FOO.BAR.> entry in the map DestinationNode child = node.getChild(ANY_DESCENDENT); if (child != null) { answer.addAll(child.getValues()); } } } }
public Collection removeDesendentValues() { Collection answer = new ArrayList(); Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); answer.addAll(child.removeDesendentValues()); } return answer; }
public void appendMatchingValues(Set<DestinationNode> answer, String[] paths, int startIndex, boolean deep) { DestinationNode node = this; boolean couldMatchAny = true; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (deep && path.equals(ANY_DESCENDENT)) { answer.addAll(node.getDesendentValues()); couldMatchAny = false; break; } node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.getValues()); if (couldMatchAny) { // lets allow FOO.BAR to match the FOO.BAR.> entry in the map DestinationNode child = node.getChild(ANY_DESCENDENT); if (child != null) { answer.addAll(child.getValues()); } } } }
public DestinationNode getChild(String path) { final Collection list = new ArrayList(); Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); DestinationNode answer = child.getChild(path); if (answer != null) { list.add(answer); } } if (!list.isEmpty()) { return new AnyChildDestinationNode(this) { protected Collection getChildNodes() { return list; } }; } return null; }
public void appendMatchingValues(Set answer, String[] paths, int startIndex) { DestinationNode node = this; boolean couldMatchAny = true; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (path.equals(ANY_DESCENDENT)) { answer.addAll(node.getDesendentValues()); couldMatchAny = false; break; } node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.getValues()); if (couldMatchAny) { // lets allow FOO.BAR to match the FOO.BAR.> entry in the map DestinationNode child = node.getChild(ANY_DESCENDENT); if (child != null) { answer.addAll(child.getValues()); } } } }
public void appendMatchingValues(Set answer, String[] paths, int startIndex) { Iterator iter = getChildNodes().iterator(); while (iter.hasNext()) { DestinationNode child = (DestinationNode) iter.next(); child.appendMatchingValues(answer, paths, startIndex); } }
public void appendMatchingValues(Set<DestinationNode> answer, String[] paths, int startIndex, boolean deep) { DestinationNode node = this; boolean couldMatchAny = true; int size = paths.length; for (int i = startIndex; i < size && node != null; i++) { String path = paths[i]; if (deep && path.equals(ANY_DESCENDENT)) { answer.addAll(node.getDesendentValues()); couldMatchAny = false; break; } node.appendMatchingWildcards(answer, paths, i); if (path.equals(ANY_CHILD)) { node = new AnyChildDestinationNode(node); } else { node = node.getChild(path); } } if (node != null) { answer.addAll(node.getValues()); if (couldMatchAny) { // lets allow FOO.BAR to match the FOO.BAR.> entry in the map DestinationNode child = node.getChild(ANY_DESCENDENT); if (child != null) { answer.addAll(child.getValues()); } } } }