@Test public void testHashCode() { MyComparableObjectSeries s1 = new MyComparableObjectSeries("Test"); MyComparableObjectSeries s2 = new MyComparableObjectSeries("Test"); assertEquals(s1, s2); assertEquals(s1.hashCode(), s2.hashCode()); s1.add("A", "1"); s2.add("A", "1"); assertEquals(s1, s2); assertEquals(s1.hashCode(), s2.hashCode()); s1.add("B", null); s2.add("B", null); assertEquals(s1, s2); assertEquals(s1.hashCode(), s2.hashCode()); s1.add("C", "3"); s2.add("C", "3"); assertEquals(s1, s2); assertEquals(s1.hashCode(), s2.hashCode()); s1.add("D", "4"); s2.add("D", "4"); assertEquals(s1, s2); assertEquals(s1.hashCode(), s2.hashCode()); }
@Override public int hashCode() { int result = super.hashCode(); int count = getItemCount(); if (count > 0) { ComparableObjectItem item = getDataItem(0); result = 29 * result + item.hashCode(); } if (count > 1) { ComparableObjectItem item = getDataItem(count - 1); result = 29 * result + item.hashCode(); } if (count > 2) { ComparableObjectItem item = getDataItem(count / 2); result = 29 * result + item.hashCode(); } result = 29 * result + this.maximumItemCount; result = 29 * result + (this.autoSort ? 1 : 0); result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); return result; }
ComparableObjectSeries extends Series implements Cloneable, Serializable { @Override public int hashCode() { int result = super.hashCode(); int count = getItemCount(); if (count > 0) { ComparableObjectItem item = getDataItem(0); result = 29 * result + item.hashCode(); } if (count > 1) { ComparableObjectItem item = getDataItem(count - 1); result = 29 * result + item.hashCode(); } if (count > 2) { ComparableObjectItem item = getDataItem(count / 2); result = 29 * result + item.hashCode(); } result = 29 * result + this.maximumItemCount; result = 29 * result + (this.autoSort ? 1 : 0); result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); return result; } }
ComparableObjectSeries extends Series implements Cloneable, Serializable { @Override public int hashCode() { int result = super.hashCode(); int count = getItemCount(); if (count > 0) { ComparableObjectItem item = getDataItem(0); result = 29 * result + item.hashCode(); } if (count > 1) { ComparableObjectItem item = getDataItem(count - 1); result = 29 * result + item.hashCode(); } if (count > 2) { ComparableObjectItem item = getDataItem(count / 2); result = 29 * result + item.hashCode(); } result = 29 * result + this.maximumItemCount; result = 29 * result + (this.autoSort ? 1 : 0); result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); return result; } ComparableObjectSeries(Comparable key);  ComparableObjectSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); }
ComparableObjectSeries extends Series implements Cloneable, Serializable { @Override public int hashCode() { int result = super.hashCode(); int count = getItemCount(); if (count > 0) { ComparableObjectItem item = getDataItem(0); result = 29 * result + item.hashCode(); } if (count > 1) { ComparableObjectItem item = getDataItem(count - 1); result = 29 * result + item.hashCode(); } if (count > 2) { ComparableObjectItem item = getDataItem(count / 2); result = 29 * result + item.hashCode(); } result = 29 * result + this.maximumItemCount; result = 29 * result + (this.autoSort ? 1 : 0); result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); return result; } ComparableObjectSeries(Comparable key);  ComparableObjectSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); boolean getAutoSort(); boolean getAllowDuplicateXValues(); @Override int getItemCount(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); int indexOf(Comparable x); void clear(); ComparableObjectItem remove(Comparable x); @Override boolean equals(Object obj); @Override int hashCode(); }
ComparableObjectSeries extends Series implements Cloneable, Serializable { @Override public int hashCode() { int result = super.hashCode(); int count = getItemCount(); if (count > 0) { ComparableObjectItem item = getDataItem(0); result = 29 * result + item.hashCode(); } if (count > 1) { ComparableObjectItem item = getDataItem(count - 1); result = 29 * result + item.hashCode(); } if (count > 2) { ComparableObjectItem item = getDataItem(count / 2); result = 29 * result + item.hashCode(); } result = 29 * result + this.maximumItemCount; result = 29 * result + (this.autoSort ? 1 : 0); result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); return result; } ComparableObjectSeries(Comparable key);  ComparableObjectSeries(Comparable key, boolean autoSort,
            boolean allowDuplicateXValues); boolean getAutoSort(); boolean getAllowDuplicateXValues(); @Override int getItemCount(); int getMaximumItemCount(); void setMaximumItemCount(int maximum); int indexOf(Comparable x); void clear(); ComparableObjectItem remove(Comparable x); @Override boolean equals(Object obj); @Override int hashCode();  }