< prev index next >

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

Print this page




 825            lineOffset += scanlineStride;
 826         }
 827     }
 828 
 829     private static int[] createOffsetArray(int numBands) {
 830         int[] bandOffsets = new int[numBands];
 831         for (int i=0; i < numBands; i++) {
 832             bandOffsets[i] = 0;
 833         }
 834         return bandOffsets;
 835     }
 836 
 837     private static int[] createIndicesArray(int numBands) {
 838         int[] bankIndices = new int[numBands];
 839         for (int i=0; i < numBands; i++) {
 840             bankIndices[i] = i;
 841         }
 842         return bankIndices;
 843     }
 844 
 845     // Differentiate hash code from other ComponentSampleModel subclasses




























 846     public int hashCode() {
 847         return super.hashCode() ^ 0x2;


 848     }
 849 }


 825            lineOffset += scanlineStride;
 826         }
 827     }
 828 
 829     private static int[] createOffsetArray(int numBands) {
 830         int[] bandOffsets = new int[numBands];
 831         for (int i=0; i < numBands; i++) {
 832             bandOffsets[i] = 0;
 833         }
 834         return bandOffsets;
 835     }
 836 
 837     private static int[] createIndicesArray(int numBands) {
 838         int[] bankIndices = new int[numBands];
 839         for (int i=0; i < numBands; i++) {
 840             bankIndices[i] = i;
 841         }
 842         return bankIndices;
 843     }
 844 
 845     /**
 846      * Tests if the specified {@code Object} is an instance
 847      * of {@code BandedSampleModel} and equals this
 848      * {@code BandedSampleModel}.
 849      * @param obj the {@code Object} to test for equality
 850      * @return {@code true} if the specified {@code Object}
 851      * is an instance of {@code BandedSampleModel} and equals this
 852      * {@code BandedSampleModel}; {@code false} otherwise.
 853      */
 854     @Override
 855     public boolean equals(Object obj) {
 856 
 857         BandedSampleModel cm = (BandedSampleModel) obj;
 858         if (this == cm) {
 859             return true;
 860         }
 861 
 862         if (!super.equals(obj)) {
 863             return false;
 864         }
 865         return true;
 866     }
 867 
 868     /**
 869      * Returns the hash code for this BandedSampleModel.
 870      *
 871      * @return    a hash code for this BandedSampleModel.
 872      */
 873     @Override
 874     public int hashCode() {
 875         int hash = 5;
 876         hash = 13 * hash + super.hashCode();
 877         return hash;
 878     }
 879 }
< prev index next >