blob: 1d427e83acdb6d2e03004883f8cf47936fc79ca4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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();
}
}
|