-/** a tree (or node in a tree); see jargon.txt for details */
-public class Tree<T> extends PrintableTree<Tree<T>> implements Iterable<Tree<T>> {
+/** <font color=blue>a tree (or node in a tree); see jargon.txt for details</font> */
+public class Tree<NodeType>
+ extends PrintableTree<Tree<NodeType>>
+ implements Iterable<Tree<NodeType>> {
+
+ private final Input.Region location;
+ private final NodeType ihead;
+ private final Tree<NodeType>[] children;
+
+ /** the number of children the tree has */
+ public int size() { return children.length; }
+
+ /** the element at the head of the tree */
+ public NodeType head() { return ihead; }
+ public NodeType getHead() { return ihead; }
+
+ /** the tree's children */
+ public Iterable<Tree<NodeType>> children() { return this; }
+
+ /** the tree's children */
+ public Iterator<Tree<NodeType>> iterator() { return new ArrayIterator(children); }