Esempio n. 1
0
 @Override
 public boolean equals(Object o) {
   if (this == o) return true;
   if (o == null || getClass() != o.getClass()) return false;
   StructuralObject that = (StructuralObject) o;
   return part.structurallyEquals(that.part);
 }
Esempio n. 2
0
  protected static boolean structurallyEquals(LiRhsPart[] left, LiRhsPart[] right) {
    if (left == right) {
      return true;
    }
    if (left == null || right == null) {
      return false;
    }

    int length = left.length;
    if (right.length != length) {
      return false;
    }

    for (int i = 0; i < length; i++) {
      LiRhsPart l = left[i];
      LiRhsPart r = right[i];
      if (l == null ? r != null : !l.structurallyEquals(r)) return false;
    }

    return true;
  }