Class ContourPlot.Iterators.ImgAreaIterator<P extends ContourPlot.PixelBase>

  • Type Parameters:
    P - the pixel type of this iterator
    All Implemented Interfaces:
    java.util.Iterator<P>
    Enclosing class:
    ContourPlot.Iterators

    public static class ContourPlot.Iterators.ImgAreaIterator<P extends ContourPlot.PixelBase>
    extends java.lang.Object
    implements java.util.Iterator<P>
    The standard iterator class for iterating over an area of an image.
    Author:
    hageldave
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int height  
      private P px  
      private int width  
      private int x  
      private int xStart  
      private int y  
      private int yStart  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImgAreaIterator​(int xStart, int yStart, int width, int height, P px)
      Creates a new ImgAreaIterator for iterating the pixels in the specified area of an image.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forEachRemaining​(java.util.function.Consumer<? super P> action)  
      boolean hasNext()  
      P next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        remove
    • Field Detail

      • xStart

        private final int xStart
      • yStart

        private final int yStart
      • width

        private final int width
      • height

        private final int height
      • x

        private int x
      • y

        private int y
    • Constructor Detail

      • ImgAreaIterator

        public ImgAreaIterator​(int xStart,
                               int yStart,
                               int width,
                               int height,
                               P px)
        Creates a new ImgAreaIterator for iterating the pixels in the specified area of an image. The iterated image is the source of the specified pixel. The specified pixel will be reused on every invocation of next() with incremented index.
        Parameters:
        xStart - the left boundary of the area (inclusive)
        yStart - the top boundary of the area (inclusive)
        width - of the area
        height - of the area
        px - the pixel used for iterating
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<P extends ContourPlot.PixelBase>
      • forEachRemaining

        public void forEachRemaining​(java.util.function.Consumer<? super P> action)
        Specified by:
        forEachRemaining in interface java.util.Iterator<P extends ContourPlot.PixelBase>