@Test public void testEquals() { PieLabelRecord p1 = new PieLabelRecord("A", 1.0, 2.0, new TextBox("B"), 3.0, 4.0, 5.0); PieLabelRecord p2 = new PieLabelRecord("A", 1.0, 2.0, new TextBox("B"), 3.0, 4.0, 5.0); assertEquals(p1, p2); assertEquals(p2, p1); p1 = new PieLabelRecord("B", 1.0, 2.0, new TextBox("B"), 3.0, 4.0, 5.0); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.0, 2.0, new TextBox("B"), 3.0, 4.0, 5.0); assertEquals(p1, p2); p1 = new PieLabelRecord("B", 1.1, 2.0, new TextBox("B"), 3.0, 4.0, 5.0); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.1, 2.0, new TextBox("B"), 3.0, 4.0, 5.0); assertEquals(p1, p2); p1 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("B"), 3.0, 4.0, 5.0); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("B"), 3.0, 4.0, 5.0); assertEquals(p1, p2); p1 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.0, 4.0, 5.0); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.0, 4.0, 5.0); assertEquals(p1, p2); p1 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.3, 4.0, 5.0); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.3, 4.0, 5.0); assertEquals(p1, p2); p1 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.3, 4.4, 5.0); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.3, 4.4, 5.0); assertEquals(p1, p2); p1 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.3, 4.4, 5.5); assertFalse(p1.equals(p2)); p2 = new PieLabelRecord("B", 1.1, 2.2, new TextBox("C"), 3.3, 4.4, 5.5); assertEquals(p1, p2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true; }
PieLabelRecord implements Comparable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true; } }
PieLabelRecord implements Comparable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true; } PieLabelRecord(Comparable key, double angle, double baseY,
                          TextBox label, double labelHeight, double gap,
                          double linkPercent); }
PieLabelRecord implements Comparable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true; } PieLabelRecord(Comparable key, double angle, double baseY,
                          TextBox label, double labelHeight, double gap,
                          double linkPercent); double getBaseY(); void setBaseY(double base); double getLowerY(); double getUpperY(); double getAngle(); Comparable getKey(); TextBox getLabel(); double getLabelHeight(); double getAllocatedY(); void setAllocatedY(double y); double getGap(); double getLinkPercent(); @Override int compareTo(Object obj); @Override boolean equals(Object obj); @Override String toString(); }
PieLabelRecord implements Comparable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof PieLabelRecord)) { return false; } PieLabelRecord that = (PieLabelRecord) obj; if (!this.key.equals(that.key)) { return false; } if (this.angle != that.angle) { return false; } if (this.gap != that.gap) { return false; } if (this.allocatedY != that.allocatedY) { return false; } if (this.baseY != that.baseY) { return false; } if (this.labelHeight != that.labelHeight) { return false; } if (this.linkPercent != that.linkPercent) { return false; } if (!this.label.equals(that.label)) { return false; } return true; } PieLabelRecord(Comparable key, double angle, double baseY,
                          TextBox label, double labelHeight, double gap,
                          double linkPercent); double getBaseY(); void setBaseY(double base); double getLowerY(); double getUpperY(); double getAngle(); Comparable getKey(); TextBox getLabel(); double getLabelHeight(); double getAllocatedY(); void setAllocatedY(double y); double getGap(); double getLinkPercent(); @Override int compareTo(Object obj); @Override boolean equals(Object obj); @Override String toString();  }