/**
* Tests this series for equality with an arbitrary object.
*
* @param obj the object to test against for equality
* (<code>null</code> permitted).
*
* @return A boolean.
*/
/**
* Tests this series for equality with an arbitrary object.
*
* @param obj the object to test against for equality
* (<code>null</code> permitted).
*
* @return A boolean.
*/
public boolean equals(Object obj) {
if (obj == this ) {
return true;
}
if ( !(obj instanceof [[#variable18bf8060]])) {
return false;
}
if ( !super.equals(obj)) {
return false;
}
[[#variable18bf8060]] that = ( [[#variable18bf8060]]) obj;
if (this.maximumItemCount != that.maximumItemCount) {
return false;
}
if (this.autoSort != that.autoSort) {
return false;
}
if (this.allowDuplicateXValues != that.allowDuplicateXValues) {
return false;
}
if ( !ObjectUtilities.equal(this.data, that.data)) {
return false;
}
return true;
}
/**
* Returns a hash code.
*
* @return A hash code.
*/
/**
* Returns a hash code.
*
* @return A hash code.
*/
public int hashCode() {
int result = super.hashCode();
// it is too slow to look at every data item, so let's just look at
// the first, middle and last items...
int count = getItemCount();
if (count > 0) {
[[#variable18bed040]] item = getDataItem(0);
result = 29 * result + item.hashCode();
}
if (count > 1) {
[[#variable18bed040]] item = getDataItem(count - 1);
result = 29 * result + item.hashCode();
}
if (count > 2) {
[[#variable18bed040]] 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;
}
|