Exemplo n.º 1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (!(obj instanceof Ray2D)) return false;
    Ray2D that = (Ray2D) obj;

    // Compare each field
    if (!EqualUtils.areEqual(this.x0, that.x0)) return false;
    if (!EqualUtils.areEqual(this.y0, that.y0)) return false;
    if (!EqualUtils.areEqual(this.dx, that.dx)) return false;
    if (!EqualUtils.areEqual(this.dy, that.dy)) return false;

    return true;
  }
Exemplo n.º 2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj instanceof Circle2D) {
      Circle2D that = (Circle2D) obj;

      // Compare each field
      if (!EqualUtils.areEqual(this.xc, that.xc)) return false;
      if (!EqualUtils.areEqual(this.yc, that.yc)) return false;
      if (!EqualUtils.areEqual(this.r, that.r)) return false;
      if (this.direct != that.direct) return false;

      return true;
    }
    return super.equals(obj);
  }
Exemplo n.º 3
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;

    if (!(obj instanceof EllipseArc2D)) return false;
    EllipseArc2D that = (EllipseArc2D) obj;

    // test whether supporting ellipses have same support
    if (!this.ellipse.equals(that.ellipse)) return false;

    // test if angles are the same
    if (!EqualUtils.areEqual(startAngle, that.startAngle)) return false;
    if (!EqualUtils.areEqual(angleExtent, that.angleExtent)) return false;

    return true;
  }