@@ -130,7 +130,8 @@ public BandedSampleModel(int dataType,
130130 * @throws IllegalArgumentException if <code>dataType</code> is not
131131 * one of the supported data types
132132 */
133- public SampleModel createCompatibleSampleModel (int w , int h ) {
133+ @ Override
134+ public SampleModel createCompatibleSampleModel (int w , int h ) {
134135 int [] bandOffs ;
135136
136137 if (numBanks == 1 ) {
@@ -157,7 +158,8 @@ public SampleModel createCompatibleSampleModel(int w, int h) {
157158 * @throws IllegalArgumentException if <code>dataType</code> is not
158159 * one of the supported data types
159160 */
160- public SampleModel createSubsetSampleModel (int bands []) {
161+ @ Override
162+ public SampleModel createSubsetSampleModel (int bands []) {
161163 if (bands .length > bankIndices .length )
162164 throw new RasterFormatException ("There are only " +
163165 bankIndices .length +
@@ -182,7 +184,8 @@ public SampleModel createSubsetSampleModel(int bands[]) {
182184 * @throws IllegalArgumentException if <code>dataType</code> is not
183185 * one of the supported types.
184186 */
185- public DataBuffer createDataBuffer () {
187+ @ Override
188+ public DataBuffer createDataBuffer () {
186189 DataBuffer dataBuffer = null ;
187190
188191 int size = scanlineStride * height ;
@@ -253,11 +256,15 @@ public DataBuffer createDataBuffer() {
253256 * @return the data for the specified pixel.
254257 * @see #setDataElements(int, int, Object, DataBuffer)
255258 */
256- public Object getDataElements (int x , int y , Object obj , DataBuffer data ) {
259+ @ Override
260+ public Object getDataElements (int x , int y , Object obj , DataBuffer data ) {
257261 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
258262 throw new ArrayIndexOutOfBoundsException
259263 ("Coordinate out of bounds!" );
260264 }
265+
266+ data .秘setDoCheckImage (false );
267+
261268 int type = getTransferType ();
262269 int numDataElems = getNumDataElements ();
263270 int pixelOffset = y *scanlineStride + x ;
@@ -355,6 +362,7 @@ public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
355362 obj = (Object )ddata ;
356363 break ;
357364 }
365+ data .秘setDoCheckImage (true );
358366
359367 return obj ;
360368 }
@@ -370,7 +378,8 @@ public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
370378 * @return the samples for the specified pixel.
371379 * @see #setPixel(int, int, int[], DataBuffer)
372380 */
373- public int [] getPixel (int x , int y , int iArray [], DataBuffer data ) {
381+ @ Override
382+ public int [] getPixel (int x , int y , int iArray [], DataBuffer data ) {
374383 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
375384 throw new ArrayIndexOutOfBoundsException
376385 ("Coordinate out of bounds!" );
@@ -406,7 +415,8 @@ public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
406415 * @return the samples for the pixels within the specified region.
407416 * @see #setPixels(int, int, int, int, int[], DataBuffer)
408417 */
409- public int [] getPixels (int x , int y , int w , int h ,
418+ @ Override
419+ public int [] getPixels (int x , int y , int w , int h ,
410420 int iArray [], DataBuffer data ) {
411421 int x1 = x + w ;
412422 int y1 = y + h ;
@@ -417,6 +427,9 @@ public int[] getPixels(int x, int y, int w, int h,
417427 throw new ArrayIndexOutOfBoundsException
418428 ("Coordinate out of bounds!" );
419429 }
430+
431+ data .秘setDoCheckImage (false );
432+
420433 int [] pixels ;
421434
422435 if (iArray != null ) {
@@ -439,6 +452,9 @@ public int[] getPixels(int x, int y, int w, int h,
439452 lineOffset += scanlineStride ;
440453 }
441454 }
455+
456+ data .秘setDoCheckImage (true );
457+
442458 return pixels ;
443459 }
444460
@@ -454,7 +470,8 @@ public int[] getPixels(int x, int y, int w, int h,
454470 * @return the sample in the specified band for the specified pixel.
455471 * @see #setSample(int, int, int, int, DataBuffer)
456472 */
457- public int getSample (int x , int y , int b , DataBuffer data ) {
473+ @ Override
474+ public int getSample (int x , int y , int b , DataBuffer data ) {
458475 // Bounds check for 'b' will be performed automatically
459476 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
460477 throw new ArrayIndexOutOfBoundsException
@@ -478,7 +495,8 @@ public int getSample(int x, int y, int b, DataBuffer data) {
478495 * @return a float value that represents the sample in the specified
479496 * band for the specified pixel.
480497 */
481- public float getSampleFloat (int x , int y , int b , DataBuffer data ) {
498+ @ Override
499+ public float getSampleFloat (int x , int y , int b , DataBuffer data ) {
482500 // Bounds check for 'b' will be performed automatically
483501 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
484502 throw new ArrayIndexOutOfBoundsException
@@ -502,7 +520,8 @@ public float getSampleFloat(int x, int y, int b, DataBuffer data) {
502520 * @return a double value that represents the sample in the specified
503521 * band for the specified pixel.
504522 */
505- public double getSampleDouble (int x , int y , int b , DataBuffer data ) {
523+ @ Override
524+ public double getSampleDouble (int x , int y , int b , DataBuffer data ) {
506525 // Bounds check for 'b' will be performed automatically
507526 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
508527 throw new ArrayIndexOutOfBoundsException
@@ -530,13 +549,17 @@ public double getSampleDouble(int x, int y, int b, DataBuffer data) {
530549 * the specified region.
531550 * @see #setSamples(int, int, int, int, int, int[], DataBuffer)
532551 */
533- public int [] getSamples (int x , int y , int w , int h , int b ,
552+ @ Override
553+ public int [] getSamples (int x , int y , int w , int h , int b ,
534554 int iArray [], DataBuffer data ) {
535555 // Bounds check for 'b' will be performed automatically
536556 if ((x < 0 ) || (y < 0 ) || (x + w > width ) || (y + h > height )) {
537557 throw new ArrayIndexOutOfBoundsException
538558 ("Coordinate out of bounds!" );
539559 }
560+
561+ data .秘setDoCheckImage (false );
562+
540563 int samples [];
541564 if (iArray != null ) {
542565 samples = iArray ;
@@ -555,6 +578,9 @@ public int[] getSamples(int x, int y, int w, int h, int b,
555578 }
556579 lineOffset += scanlineStride ;
557580 }
581+
582+ data .秘setDoCheckImage (true );
583+
558584 return samples ;
559585 }
560586
@@ -593,11 +619,15 @@ public int[] getSamples(int x, int y, int w, int h, int b,
593619 * @param data The DataBuffer containing the image data
594620 * @see #getDataElements(int, int, Object, DataBuffer)
595621 */
596- public void setDataElements (int x , int y , Object obj , DataBuffer data ) {
622+ @ Override
623+ public void setDataElements (int x , int y , Object obj , DataBuffer data ) {
597624 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
598625 throw new ArrayIndexOutOfBoundsException
599626 ("Coordinate out of bounds!" );
600627 }
628+
629+ data .秘setDoCheckImage (false );
630+
601631 int type = getTransferType ();
602632 int numDataElems = getNumDataElements ();
603633 int pixelOffset = y *scanlineStride + x ;
@@ -656,6 +686,8 @@ public void setDataElements(int x, int y, Object obj, DataBuffer data) {
656686 break ;
657687
658688 }
689+ data .秘setDoCheckImage (true );
690+
659691 }
660692
661693 /**
@@ -668,7 +700,8 @@ public void setDataElements(int x, int y, Object obj, DataBuffer data) {
668700 * @param data The DataBuffer containing the image data
669701 * @see #getPixel(int, int, int[], DataBuffer)
670702 */
671- public void setPixel (int x , int y , int iArray [], DataBuffer data ) {
703+ @ Override
704+ public void setPixel (int x , int y , int iArray [], DataBuffer data ) {
672705 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
673706 throw new ArrayIndexOutOfBoundsException
674707 ("Coordinate out of bounds!" );
@@ -693,7 +726,8 @@ public void setPixel(int x, int y, int iArray[], DataBuffer data) {
693726 * @param data The DataBuffer containing the image data
694727 * @see #getPixels(int, int, int, int, int[], DataBuffer)
695728 */
696- public void setPixels (int x , int y , int w , int h ,
729+ @ Override
730+ public void setPixels (int x , int y , int w , int h ,
697731 int iArray [], DataBuffer data ) {
698732 int x1 = x + w ;
699733 int y1 = y + h ;
@@ -704,6 +738,9 @@ public void setPixels(int x, int y, int w, int h,
704738 throw new ArrayIndexOutOfBoundsException
705739 ("Coordinate out of bounds!" );
706740 }
741+
742+ data .秘setDoCheckImage (false );
743+
707744
708745 for (int k = 0 ; k < numBands ; k ++) {
709746 int lineOffset = y *scanlineStride + x + bandOffsets [k ];
@@ -719,6 +756,7 @@ public void setPixels(int x, int y, int w, int h,
719756 lineOffset += scanlineStride ;
720757 }
721758 }
759+ data .秘setDoCheckImage (true );
722760 }
723761
724762 /**
@@ -733,7 +771,8 @@ public void setPixels(int x, int y, int w, int h,
733771 * @param data The DataBuffer containing the image data
734772 * @see #getSample(int, int, int, DataBuffer)
735773 */
736- public void setSample (int x , int y , int b , int s ,
774+ @ Override
775+ public void setSample (int x , int y , int b , int s ,
737776 DataBuffer data ) {
738777 // Bounds check for 'b' will be performed automatically
739778 if ((x < 0 ) || (y < 0 ) || (x >= width ) || (y >= height )) {
@@ -756,7 +795,8 @@ public void setSample(int x, int y, int b, int s,
756795 * @param data The DataBuffer containing the image data
757796 * @see #getSample(int, int, int, DataBuffer)
758797 */
759- public void setSample (int x , int y , int b ,
798+ @ Override
799+ public void setSample (int x , int y , int b ,
760800 float s ,
761801 DataBuffer data ) {
762802 // Bounds check for 'b' will be performed automatically
@@ -780,7 +820,8 @@ public void setSample(int x, int y, int b,
780820 * @param data The DataBuffer containing the image data
781821 * @see #getSample(int, int, int, DataBuffer)
782822 */
783- public void setSample (int x , int y , int b ,
823+ @ Override
824+ public void setSample (int x , int y , int b ,
784825 double s ,
785826 DataBuffer data ) {
786827 // Bounds check for 'b' will be performed automatically
@@ -806,13 +847,17 @@ public void setSample(int x, int y, int b,
806847 * @param data The DataBuffer containing the image data
807848 * @see #getSamples(int, int, int, int, int, int[], DataBuffer)
808849 */
809- public void setSamples (int x , int y , int w , int h , int b ,
850+ @ Override
851+ public void setSamples (int x , int y , int w , int h , int b ,
810852 int iArray [], DataBuffer data ) {
811853 // Bounds check for 'b' will be performed automatically
812854 if ((x < 0 ) || (y < 0 ) || (x + w > width ) || (y + h > height )) {
813855 throw new ArrayIndexOutOfBoundsException
814856 ("Coordinate out of bounds!" );
815857 }
858+
859+ data .秘setDoCheckImage (false );
860+
816861 int lineOffset = y *scanlineStride + x + bandOffsets [b ];
817862 int srcOffset = 0 ;
818863 int bank = bankIndices [b ];
@@ -824,6 +869,7 @@ public void setSamples(int x, int y, int w, int h, int b,
824869 }
825870 lineOffset += scanlineStride ;
826871 }
872+ data .秘setDoCheckImage (true );
827873 }
828874
829875 private static int [] createOffsetArray (int numBands ) {
@@ -843,7 +889,8 @@ private static int[] createIndicesArray(int numBands) {
843889 }
844890
845891 // Differentiate hash code from other ComponentSampleModel subclasses
846- public int hashCode () {
892+ @ Override
893+ public int hashCode () {
847894 return super .hashCode () ^ 0x2 ;
848895 }
849896}
0 commit comments