package model.html; import model.util.AbstractTree; import org.javatuples.Pair; import java.util.ArrayList; import java.util.Optional; /** * Representation of HTML as a tree of nodes. Sorry about the generics. */ public class HtmlTree extends AbstractTree>>> { private String tag; private ArrayList> attributes; private Optional parent = Optional.empty(); private Optional sibling = Optional.empty(); // I don't quite know why I can't say ArrayList children. public HtmlTree(String tag, ArrayList> attributes, ArrayList>>>> children, Optional parent, Optional sibling) { super(new Pair<>(tag, attributes), children); this.tag = tag; this.attributes = attributes; this.parent = parent; this.sibling = sibling; } public HtmlTree(String tag, ArrayList> attributes) { this(tag, attributes, new ArrayList>>>>(), Optional.empty(), Optional.empty()); } }