diff options
Diffstat (limited to 'src/main/model/html/ElementNode.java')
-rw-r--r-- | src/main/model/html/ElementNode.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/model/html/ElementNode.java b/src/main/model/html/ElementNode.java new file mode 100644 index 0000000..1d427e8 --- /dev/null +++ b/src/main/model/html/ElementNode.java @@ -0,0 +1,40 @@ +package model.html; + +import model.util.Node; +import org.javatuples.Pair; + +import java.util.ArrayList; +import java.util.Optional; + +public class ElementNode implements Node { + private String tag; + private ArrayList<Pair<String,String>> attributes; + + private ArrayList<Node> children; + + public String getTag() { + return this.tag; + } + + public ArrayList<Node> getChildren() { + return this.children; + } + + public ElementNode(String tag, ArrayList<Pair<String, String>> attributes, ArrayList<Node> children) { + this.tag = tag; + this.attributes = attributes; + this.children = children; + } + + public ElementNode(String tag, ArrayList<Pair<String, String>> attributes) { + this(tag, attributes, new ArrayList<Node>()); + } + + public void addChild(Node child) { + this.children.add(child); + } + + public String getData() { + return getTag(); + } +} |