Class DataIterator3D<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    java.util.Iterator<T>


    public class DataIterator3D<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    An iterator iterating over a 3d array. Starts outside the array so first call before acces must be next().
    • Constructor Summary

      Constructors 
      Constructor Description
      DataIterator3D​(T[][][] data, int startingZ, int limitZ)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int[] getCurrentIndex​()
      get the reference to the indices position of the iterator
      boolean hasNext​()  
      T next​()
      first iterates z then x then y
      void remove​()  
      void restart​()  
      void setBorders​(int left, int right, int back, int front)
      sets index position borders during iterations.
      void setTopLimitZ​(int zLimit)
      set the top/last limit of the iteration (including).
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataIterator3D

        public DataIterator3D​(T[][][] data,
                              int startingZ,
                              int limitZ)
        Parameters:
        data -
        startingZ - the starting layer
        limitZ - the last layer (including).
    • Method Detail

      • setTopLimitZ

        public void setTopLimitZ​(int zLimit)
        set the top/last limit of the iteration (including).
        Parameters:
        zLimit -
      • hasNext

        public boolean hasNext​()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next​()
        first iterates z then x then y
        Specified by:
        next in interface java.util.Iterator<T>
        Returns:
      • remove

        public void remove​()
        Specified by:
        remove in interface java.util.Iterator<T>
      • getCurrentIndex

        public int[] getCurrentIndex​()
        get the reference to the indices position of the iterator
        Returns:
      • setBorders

        public void setBorders​(int left,
                               int right,
                               int back,
                               int front)
        sets index position borders during iterations. This reduces greatly the amount of blocks which are traversed.
        Parameters:
        left - index positions, no grid coordinates
        right - index positions, no grid coordinates
        back - index positions, no grid coordinates
        front - index positions, no grid coordinates
      • restart

        public void restart​()