home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / java2d / pipe / RegionIterator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  942 b   |  52 lines

  1. package sun.java2d.pipe;
  2.  
  3. public class RegionIterator {
  4.    Region region;
  5.    int curIndex;
  6.    int numXbands;
  7.  
  8.    RegionIterator(Region var1) {
  9.       this.region = var1;
  10.    }
  11.  
  12.    public RegionIterator createCopy() {
  13.       RegionIterator var1 = new RegionIterator(this.region);
  14.       var1.curIndex = this.curIndex;
  15.       var1.numXbands = this.numXbands;
  16.       return var1;
  17.    }
  18.  
  19.    public void copyStateFrom(RegionIterator var1) {
  20.       if (this.region != var1.region) {
  21.          throw new InternalError("region mismatch");
  22.       } else {
  23.          this.curIndex = var1.curIndex;
  24.          this.numXbands = var1.numXbands;
  25.       }
  26.    }
  27.  
  28.    public boolean nextYRange(int[] var1) {
  29.       this.curIndex += this.numXbands * 2;
  30.       this.numXbands = 0;
  31.       if (this.curIndex >= this.region.endIndex) {
  32.          return false;
  33.       } else {
  34.          var1[0] = this.region.bands[this.curIndex++];
  35.          var1[1] = this.region.bands[this.curIndex++];
  36.          this.numXbands = this.region.bands[this.curIndex++];
  37.          return true;
  38.       }
  39.    }
  40.  
  41.    public boolean nextXBand(int[] var1) {
  42.       if (this.numXbands <= 0) {
  43.          return false;
  44.       } else {
  45.          --this.numXbands;
  46.          var1[2] = this.region.bands[this.curIndex++];
  47.          var1[3] = this.region.bands[this.curIndex++];
  48.          return true;
  49.       }
  50.    }
  51. }
  52.