Example #1
0
  public void printInfo() {
    if (this.parent == null) {
      System.out.println("null" + "-->" + this.name);
    } else {
      System.out.println(this.parent.getName() + "-->" + this.name);
    }

    for (ITree item : itemList) {
      item.printInfo();
    }
  }
Example #2
0
 public void add(ITree item) {
   item.setParent(this);
 }
Example #3
0
 public void setParent(ITree container) {
   this.parent = container;
   container.getChildren().add(this);
 }
Example #4
0
 public boolean equals(Object o) {
   if (!(o instanceof ITree)) return false;
   ITree t = (ITree) o;
   if (!((elem == null && t.root() == null) || elem.equals(t.root()))) return false;
   return (Arrays.equals(subTrees, t.getSubTrees()));
 }