< prev index next >

src/java.desktop/share/classes/java/awt/image/PixelInterleavedSampleModel.java

Print this page

        

*** 162,171 **** return new PixelInterleavedSampleModel(this.dataType, width, height, this.pixelStride, scanlineStride, newBandOffsets); } ! // Differentiate hash code from other ComponentSampleModel subclasses public int hashCode() { ! return super.hashCode() ^ 0x1; } } --- 162,201 ---- return new PixelInterleavedSampleModel(this.dataType, width, height, this.pixelStride, scanlineStride, newBandOffsets); } ! /** ! * Tests if the specified {@code Object} is an instance ! * of {@code PixelInterleavedSampleModel} and equals this ! * {@code PixelInterleavedSampleModel}. ! * @param obj the {@code Object} to test for equality ! * @return {@code true} if the specified {@code Object} ! * is an instance of {@code PixelInterleavedSampleModel} and equals this ! * {@code PixelInterleavedSampleModel}; {@code false} otherwise. ! */ ! @Override ! public boolean equals(Object obj) { ! ! PixelInterleavedSampleModel cm = (PixelInterleavedSampleModel) obj; ! if (this == cm) { ! return true; ! } ! ! if (!super.equals(obj)) { ! return false; ! } ! return true; ! } ! ! /** ! * Returns the hash code for this PixelInterleavedSampleModel. ! * ! * @return a hash code for this PixelInterleavedSampleModel. ! */ ! @Override public int hashCode() { ! int hash = 3; ! hash = 11 * hash + super.hashCode(); ! return hash; } }
< prev index next >