1   package ixa.kaflib;
2   
3   import java.io.Serializable;
4   import java.util.List;
5   
6   public abstract class TreeNode implements Serializable {
7   
8       /** The ID of the node */
9       private String id;
10  
11      /** The id of the edge between this node and its parent. */
12      private String edgeId;
13  
14      /** Wether the edge between this node and its parent is the "head" or not. */
15      private boolean head;
16  
17      private boolean isTerminal;
18  
19  
20      public TreeNode(String id, boolean head, boolean isTerminal) {
21  	this.id = id;
22  	this.head = head;
23  	this.isTerminal = isTerminal;
24      }
25  
26      public String getId() {
27  	return this.id;
28      }
29  
30      public void setId(String id) {
31  	this.id = id;
32      }
33  
34      public boolean hasEdgeId() {
35  	return this.edgeId != null;
36      }
37  
38      public String getEdgeId() {
39  	return this.edgeId;
40      }
41  
42      public void setEdgeId(String edgeId) {
43  	this.edgeId = edgeId;
44      }
45  
46      public boolean getHead() {
47  	return this.head;
48      }
49  
50      public void setHead(boolean head) {
51  	this.head = head;
52      }
53  
54      public boolean isTerminal() {
55  	return isTerminal;
56      }
57  
58      public abstract void addChild(TreeNode tn) throws Exception;
59  
60      public abstract List<TreeNode> getChildren();
61  
62  }