public Attribute(Attribute otherAttr) { this(); set(otherAttr); }
public void addAttribute(String name, String value) { Attribute attr = new Attribute(name, value); addAttribute(attr); }
public String getAttributeValue(String name) { Attribute attr = getAttribute(name); if (attr != null) return attr.getValue(); return ""; }
public Attribute getAttribute(String name) { if (name == null) return null; int nLists = size(); for (int n=0; n<nLists; n++) { Attribute elem = getAttribute(n); if (name.compareTo(elem.getName()) == 0) return elem; } return null; } }
public boolean set(Node otherNode) { if (otherNode == null) return false; setName(otherNode.getName()); setValue(otherNode.getValue()); removeAllAttributes(); int nOtherAttributes = otherNode.getNAttributes(); for (int n=0; n<nOtherAttributes; n++) { Attribute otherAttr = otherNode.getAttribute(n); Attribute thisAttr = new Attribute(otherAttr); addAttribute(thisAttr); } removeAllNodes(); int nOtherChildNodes = otherNode.getNNodes(); for (int n=0; n<nOtherChildNodes; n++) { Node otherChildNode = otherNode.getNode(n); Node thisChildNode = new Node(); thisChildNode.set(otherChildNode); addNode(thisChildNode); } return true; }
public String getAttributeValue(String name) { Attribute attr = getAttribute(name); if (attr != null) return attr.getValue(); return ""; }
public Attribute getAttribute(String name) { if (name == null) return null; int nLists = size(); for (int n=0; n<nLists; n++) { Attribute elem = getAttribute(n); if (name.compareTo(elem.getName()) == 0) return elem; } return null; } }
public void addAttribute(String name, String value) { Attribute attr = new Attribute(name, value); addAttribute(attr); }
public String getAttributeValue(String name) { Attribute attr = getAttribute(name); if (attr != null) return attr.getValue(); return ""; }
public Attribute getAttribute(String name) { if (name == null) return null; int nLists = size(); for (int n=0; n<nLists; n++) { Attribute elem = getAttribute(n); if (name.compareTo(elem.getName()) == 0) return elem; } return null; } }