Пример #1
0
 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;
 }
Пример #2
0
 public Node getSuperparentByType(String type) {
   if (parent == null) return null;
   if (parent.isType(type)) return parent;
   return parent.getSuperparentByType(type);
 }
Пример #3
0
 public Node getChildByType(String type) {
   for (Node child : getChildren()) {
     if (child.isType(type)) return child;
   }
   return null;
 }