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 getChildRecursive(String type, String value) { for (Node child : getChildrenByType(type)) { if (value.equals(child.getValue())) return child; } for (Node child : getChildren()) { Node ret = child.getChildRecursive(type, value); if (ret != null) return ret; } return null; }
public Node getChild(String type, String value) { for (Node child : getChildrenByType(type)) { if (value.equals(child.getValue())) return child; } return null; }
public boolean containsChild(String type, boolean value) { Node child = getChildByType(type); return child == null ? false : child.isValue(String.valueOf(value)); }
public Node getSuperparentByType(String type) { if (parent == null) return null; if (parent.isType(type)) return parent; return parent.getSuperparentByType(type); }
public String getParentId() { return parent == null ? null : parent.getId(); }
public boolean containsChildByTypeAndValueFalse(String type) { Node child = getChildByType(type); if (child == null) return false; return child.isValueFalse(); }
public Node getChildByType(String type) { for (Node child : getChildren()) { if (child.isType(type)) return child; } return null; }
public String getChildValueByType(String type) { Node child = getChildByType(type); return child == null ? null : child.getValue(); }