Ejemplo n.º 1
0
 private boolean fequalsTree(FTree other) {
   if (other == null) {
     return false;
   }
   if (this.hashCode != other.hashCode) {
     return false;
   }
   if (!this.text.equals(other.text)) {
     return false;
   }
   if (this.decendants != other.decendants) {
     return false;
   }
   if (this.getLeft() != null) {
     return this.getLeft().fequalsTreeAux(other.getLeft());
   } else if (this.getLeft() == null && other.getLeft() == null) {
     return true;
   } else {
     return false;
   }
 }
Ejemplo n.º 2
0
  private boolean fequalsTreeAux(FTree other) {
    if (other == null) {
      return false;
    }
    if (!this.text.equals(other.text)) {
      return false;
    }

    boolean res = true;
    FTree left = this.getLeft();
    if (left != null) {
      res = left.fequalsTreeAux(other.getLeft());
    }
    if (res) {
      FTree sib = this.getSibbling();
      if (sib != null) {
        res = sib.fequalsTreeAux(other.getSibbling());
      }
    }
    return res;
  }
Ejemplo n.º 3
0
 public boolean equals(Object o) {
   FTree other = (FTree) o;
   boolean res = fequalsTree(other);
   assert res == this.toStringTree().equals(other.toStringTree());
   return res;
 }