@Test public void testEquals() { XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.RED, Color.BLUE); XYBoxAnnotation a2 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.RED, Color.BLUE); assertEquals(a1, a2); assertEquals(a2, a1); a1 = new XYBoxAnnotation(2.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.RED, Color.BLUE); assertFalse(a1.equals(a2)); a2 = new XYBoxAnnotation(2.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.RED, Color.BLUE); assertEquals(a1, a2); a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), Color.RED, Color.BLUE); assertFalse(a1.equals(a2)); a2 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), Color.RED, Color.BLUE); assertEquals(a1, a2); GradientPaint gp1a = new GradientPaint(1.0f, 2.0f, Color.BLUE, 3.0f, 4.0f, Color.RED); GradientPaint gp1b = new GradientPaint(1.0f, 2.0f, Color.BLUE, 3.0f, 4.0f, Color.RED); GradientPaint gp2a = new GradientPaint(5.0f, 6.0f, Color.pink, 7.0f, 8.0f, Color.WHITE); GradientPaint gp2b = new GradientPaint(5.0f, 6.0f, Color.pink, 7.0f, 8.0f, Color.WHITE); a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1a, Color.BLUE); assertFalse(a1.equals(a2)); a2 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1b, Color.BLUE); assertEquals(a1, a2); a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1a, gp2a); assertFalse(a1.equals(a2)); a2 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0, new BasicStroke(2.3f), gp1b, gp2b); assertEquals(a1, a2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYBoxAnnotation)) { return false; } XYBoxAnnotation that = (XYBoxAnnotation) obj; if (!(this.x0 == that.x0)) { return false; } if (!(this.y0 == that.y0)) { return false; } if (!(this.x1 == that.x1)) { return false; } if (!(this.y1 == that.y1)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } return true; }
XYBoxAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYBoxAnnotation)) { return false; } XYBoxAnnotation that = (XYBoxAnnotation) obj; if (!(this.x0 == that.x0)) { return false; } if (!(this.y0 == that.y0)) { return false; } if (!(this.x1 == that.x1)) { return false; } if (!(this.y1 == that.y1)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } return true; } }
XYBoxAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYBoxAnnotation)) { return false; } XYBoxAnnotation that = (XYBoxAnnotation) obj; if (!(this.x0 == that.x0)) { return false; } if (!(this.y0 == that.y0)) { return false; } if (!(this.x1 == that.x1)) { return false; } if (!(this.y1 == that.y1)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } return true; } XYBoxAnnotation(double x0, double y0, double x1, double y1);  XYBoxAnnotation(double x0, double y0, double x1, double y1,
                           Stroke stroke, Paint outlinePaint);  XYBoxAnnotation(double x0, double y0, double x1, double y1,
                           Stroke stroke, Paint outlinePaint, Paint fillPaint); }
XYBoxAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYBoxAnnotation)) { return false; } XYBoxAnnotation that = (XYBoxAnnotation) obj; if (!(this.x0 == that.x0)) { return false; } if (!(this.y0 == that.y0)) { return false; } if (!(this.x1 == that.x1)) { return false; } if (!(this.y1 == that.y1)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } return true; } XYBoxAnnotation(double x0, double y0, double x1, double y1);  XYBoxAnnotation(double x0, double y0, double x1, double y1,
                           Stroke stroke, Paint outlinePaint);  XYBoxAnnotation(double x0, double y0, double x1, double y1,
                           Stroke stroke, Paint outlinePaint, Paint fillPaint); @Override void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                     ValueAxis domainAxis, ValueAxis rangeAxis,
                     int rendererIndex, PlotRenderingInfo info); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); }
XYBoxAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYBoxAnnotation)) { return false; } XYBoxAnnotation that = (XYBoxAnnotation) obj; if (!(this.x0 == that.x0)) { return false; } if (!(this.y0 == that.y0)) { return false; } if (!(this.x1 == that.x1)) { return false; } if (!(this.y1 == that.y1)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } return true; } XYBoxAnnotation(double x0, double y0, double x1, double y1);  XYBoxAnnotation(double x0, double y0, double x1, double y1,
                           Stroke stroke, Paint outlinePaint);  XYBoxAnnotation(double x0, double y0, double x1, double y1,
                           Stroke stroke, Paint outlinePaint, Paint fillPaint); @Override void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                     ValueAxis domainAxis, ValueAxis rangeAxis,
                     int rendererIndex, PlotRenderingInfo info); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }