| 3 | import java.util.ArrayList; |
| 4 | |
| 5 | public class Element { |
| 6 | public ArrayList<Attribute> attributes; |
| 7 | public ArrayList<Element> children; |
| 8 | public String name; |
| 9 | public String value; |
| 10 | |
| 11 | public Element(String n) { |
| 12 | name = n; |
| 13 | attributes = new ArrayList<Attribute>(); |
| 14 | children = new ArrayList<Element>(); |
| 15 | } |
| 16 | |
| 17 | public Element(String n, String v) { |
| 18 | name = n; |
| 19 | value = v; |
| 20 | attributes = new ArrayList<Attribute>(); |
| 21 | children = new ArrayList<Element>(); |
| 22 | } |
| 23 | |
| 24 | public String getNameCode() { |
| 25 | if (name == "family") { |
| 26 | return "1"; |
| 27 | } else if (name == "person") { |
| 28 | return "2"; |
| 29 | } else if (name == "firstName") { |
| 30 | return "3"; |
| 31 | } else if (name == "lastName") { |
| 32 | return "4"; |
| 33 | } else if (name == "state") { |
| 34 | return "5"; |
| 35 | } |
| 36 | return "--"; |
| 37 | } |
| 38 | |
| 39 | public void insert(Attribute attribute) { |
| 40 | attributes.add(attribute); |
| 41 | } |
| 42 | |
| 43 | public void insert(Element child) { |
| 44 | children.add(child); |
| 45 | } |
| 46 | } |
nothing calls this directly
no outgoing calls
no test coverage detected