@Test public void testEquals() { String f1 = "{1}"; String f2 = "{2}"; NumberFormat xnf1 = new DecimalFormat("0.00"); NumberFormat xnf2 = new DecimalFormat("0.000"); NumberFormat ynf1 = new DecimalFormat("0.00"); NumberFormat ynf2 = new DecimalFormat("0.000"); StandardXYItemLabelGenerator g1; StandardXYItemLabelGenerator g2; g1 = new StandardXYItemLabelGenerator(f1, xnf1, ynf1); g2 = new StandardXYItemLabelGenerator(f1, xnf1, ynf1); assertEquals(g1, g2); assertEquals(g2, g1); g1 = new StandardXYItemLabelGenerator(f2, xnf1, ynf1); assertFalse(g1.equals(g2)); g2 = new StandardXYItemLabelGenerator(f2, xnf1, ynf1); assertEquals(g1, g2); g1 = new StandardXYItemLabelGenerator(f2, xnf2, ynf1); assertFalse(g1.equals(g2)); g2 = new StandardXYItemLabelGenerator(f2, xnf2, ynf1); assertEquals(g1, g2); g1 = new StandardXYItemLabelGenerator(f2, xnf2, ynf2); assertFalse(g1.equals(g2)); g2 = new StandardXYItemLabelGenerator(f2, xnf2, ynf2); assertEquals(g1, g2); DateFormat xdf1 = new SimpleDateFormat("d-MMM"); DateFormat xdf2 = new SimpleDateFormat("d-MMM-yyyy"); DateFormat ydf1 = new SimpleDateFormat("d-MMM"); DateFormat ydf2 = new SimpleDateFormat("d-MMM-yyyy"); g1 = new StandardXYItemLabelGenerator(f1, xdf1, ydf1); g2 = new StandardXYItemLabelGenerator(f1, xdf1, ydf1); assertEquals(g1, g2); assertEquals(g2, g1); g1 = new StandardXYItemLabelGenerator(f1, xdf2, ydf1); assertFalse(g1.equals(g2)); g2 = new StandardXYItemLabelGenerator(f1, xdf2, ydf1); assertEquals(g1, g2); g1 = new StandardXYItemLabelGenerator(f1, xdf2, ydf2); assertFalse(g1.equals(g2)); g2 = new StandardXYItemLabelGenerator(f1, xdf2, ydf2); assertEquals(g1, g2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof StandardXYItemLabelGenerator)) { return false; } return super.equals(obj); }
StandardXYItemLabelGenerator extends AbstractXYItemLabelGenerator implements XYItemLabelGenerator, Cloneable, PublicCloneable,
            Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof StandardXYItemLabelGenerator)) { return false; } return super.equals(obj); } }
StandardXYItemLabelGenerator extends AbstractXYItemLabelGenerator implements XYItemLabelGenerator, Cloneable, PublicCloneable,
            Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof StandardXYItemLabelGenerator)) { return false; } return super.equals(obj); } StandardXYItemLabelGenerator();  StandardXYItemLabelGenerator(String formatString);  StandardXYItemLabelGenerator(String formatString,
            NumberFormat xFormat, NumberFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            DateFormat xFormat, NumberFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            NumberFormat xFormat, DateFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            DateFormat xFormat, DateFormat yFormat); }
StandardXYItemLabelGenerator extends AbstractXYItemLabelGenerator implements XYItemLabelGenerator, Cloneable, PublicCloneable,
            Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof StandardXYItemLabelGenerator)) { return false; } return super.equals(obj); } StandardXYItemLabelGenerator();  StandardXYItemLabelGenerator(String formatString);  StandardXYItemLabelGenerator(String formatString,
            NumberFormat xFormat, NumberFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            DateFormat xFormat, NumberFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            NumberFormat xFormat, DateFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            DateFormat xFormat, DateFormat yFormat); @Override String generateLabel(XYDataset dataset, int series, int item); @Override Object clone(); @Override boolean equals(Object obj); }
StandardXYItemLabelGenerator extends AbstractXYItemLabelGenerator implements XYItemLabelGenerator, Cloneable, PublicCloneable,
            Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof StandardXYItemLabelGenerator)) { return false; } return super.equals(obj); } StandardXYItemLabelGenerator();  StandardXYItemLabelGenerator(String formatString);  StandardXYItemLabelGenerator(String formatString,
            NumberFormat xFormat, NumberFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            DateFormat xFormat, NumberFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            NumberFormat xFormat, DateFormat yFormat);  StandardXYItemLabelGenerator(String formatString,
            DateFormat xFormat, DateFormat yFormat); @Override String generateLabel(XYDataset dataset, int series, int item); @Override Object clone(); @Override boolean equals(Object obj); static final String DEFAULT_ITEM_LABEL_FORMAT; }