Пример #1
0
  @Override
  public boolean equals(Object obj) {
    if (obj == null) return false;

    PointList other = (PointList) obj;
    if (other.isEmpty() && other.isEmpty()) return true;

    if (this.getSize() != other.getSize() || this.is3D() != other.is3D()) return false;

    for (int i = 0; i < size; i++) {
      if (!NumHelper.equalsEps(latitudes[i], other.latitudes[i])) return false;

      if (!NumHelper.equalsEps(longitudes[i], other.longitudes[i])) return false;

      if (is3D && !NumHelper.equalsEps(elevations[i], other.elevations[i])) return false;
    }
    return true;
  }