示例#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;
 }