< 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         if (!(obj instanceof BandedSampleModel)) {
 858             return false;
 859         }
 860  
 861         BandedSampleModel cm = (BandedSampleModel) obj;
 862         if (this == cm) {
 863             return true;
 864         }
 865 
 866         if (!super.equals(obj)) {
 867             return false;
 868         }
 869         return true;
 870     }
 871 
 872     /**
 873      * Returns the hash code for this BandedSampleModel.
 874      *
 875      * @return    a hash code for this BandedSampleModel.
 876      */
 877     @Override
 878     public int hashCode() {
 879         int hash = 5;
 880         hash = 13 * hash + super.hashCode();
 881         return hash;
 882     }
 883 }
< prev index next >