@Test public void testEquals() { CategoryLabelPosition p1 = new CategoryLabelPosition( RectangleAnchor.BOTTOM_LEFT, TextBlockAnchor.CENTER_RIGHT, TextAnchor.BASELINE_LEFT, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); CategoryLabelPosition p2 = new CategoryLabelPosition( RectangleAnchor.BOTTOM_LEFT, TextBlockAnchor.CENTER_RIGHT, TextAnchor.BASELINE_LEFT, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertEquals(p1, p2); assertEquals(p2, p1); p1 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER_RIGHT, TextAnchor.BASELINE_LEFT, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertFalse(p1.equals(p2)); p2 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER_RIGHT, TextAnchor.BASELINE_LEFT, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertEquals(p1, p2); p1 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.BASELINE_LEFT, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertFalse(p1.equals(p2)); p2 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.BASELINE_LEFT, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertEquals(p1, p2); p1 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertFalse(p1.equals(p2)); p2 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 4.0, CategoryLabelWidthType.RANGE, 0.44f); assertEquals(p1, p2); p1 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0, CategoryLabelWidthType.RANGE, 0.44f); assertFalse(p1.equals(p2)); p2 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0, CategoryLabelWidthType.RANGE, 0.44f); assertEquals(p1, p2); p1 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.44f); assertFalse(p1.equals(p2)); p2 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.44f); assertEquals(p1, p2); p1 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.55f); assertFalse(p1.equals(p2)); p2 = new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.CENTER, TextAnchor.CENTER, Math.PI / 6.0, CategoryLabelWidthType.CATEGORY, 0.55f); assertEquals(p1, p2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true; }
CategoryLabelPosition implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true; } }
CategoryLabelPosition implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true; } CategoryLabelPosition();  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor);  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor,
                                 CategoryLabelWidthType widthType,
                                 float widthRatio);  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor,
                                 TextAnchor rotationAnchor,
                                 double angle,
                                 CategoryLabelWidthType widthType,
                                 float widthRatio); }
CategoryLabelPosition implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true; } CategoryLabelPosition();  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor);  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor,
                                 CategoryLabelWidthType widthType,
                                 float widthRatio);  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor,
                                 TextAnchor rotationAnchor,
                                 double angle,
                                 CategoryLabelWidthType widthType,
                                 float widthRatio); RectangleAnchor getCategoryAnchor(); TextBlockAnchor getLabelAnchor(); TextAnchor getRotationAnchor(); double getAngle(); CategoryLabelWidthType getWidthType(); float getWidthRatio(); @Override boolean equals(Object obj); @Override int hashCode(); }
CategoryLabelPosition implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true; } CategoryLabelPosition();  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor);  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor,
                                 CategoryLabelWidthType widthType,
                                 float widthRatio);  CategoryLabelPosition(RectangleAnchor categoryAnchor,
                                 TextBlockAnchor labelAnchor,
                                 TextAnchor rotationAnchor,
                                 double angle,
                                 CategoryLabelWidthType widthType,
                                 float widthRatio); RectangleAnchor getCategoryAnchor(); TextBlockAnchor getLabelAnchor(); TextAnchor getRotationAnchor(); double getAngle(); CategoryLabelWidthType getWidthType(); float getWidthRatio(); @Override boolean equals(Object obj); @Override int hashCode();  }