< prev index next >
src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java
Print this page
*** 840,849 ****
bankIndices[i] = i;
}
return bankIndices;
}
! // Differentiate hash code from other ComponentSampleModel subclasses
public int hashCode() {
! return super.hashCode() ^ 0x2;
}
}
--- 840,883 ----
bankIndices[i] = i;
}
return bankIndices;
}
! /**
! * Tests if the specified {@code Object} is an instance
! * of {@code BandedSampleModel} and equals this
! * {@code BandedSampleModel}.
! * @param obj the {@code Object} to test for equality
! * @return {@code true} if the specified {@code Object}
! * is an instance of {@code BandedSampleModel} and equals this
! * {@code BandedSampleModel}; {@code false} otherwise.
! */
! @Override
! public boolean equals(Object obj) {
!
! if (!(obj instanceof BandedSampleModel)) {
! return false;
! }
!
! BandedSampleModel cm = (BandedSampleModel) obj;
! if (this == cm) {
! return true;
! }
!
! if (!super.equals(obj)) {
! return false;
! }
! return true;
! }
!
! /**
! * Returns the hash code for this BandedSampleModel.
! *
! * @return a hash code for this BandedSampleModel.
! */
! @Override
public int hashCode() {
! int hash = 5;
! hash = 13 * hash + super.hashCode();
! return hash;
}
}
< prev index next >