public List<Node> getChildrenByType(String type) { List<Node> ret = new ArrayList<Node>(); for (Node child : getChildren()) { if (child.isType(type)) ret.add(child); } return ret; }
public Node getSuperparentByType(String type) { if (parent == null) return null; if (parent.isType(type)) return parent; return parent.getSuperparentByType(type); }
public Node getChildByType(String type) { for (Node child : getChildren()) { if (child.isType(type)) return child; } return null; }