Class stl_ArrItr<T>

java.lang.Object
com.jackmeng.stl.stl_ArrItr<T>
All Implemented Interfaces:
java.util.Iterator<T>

public class stl_ArrItr<T>
extends java.lang.Object
implements java.util.Iterator<T>
A simple transformer class for turning a regular array into an Iteratable type via Iterator.
Author:
Jack Meng
  • Field Summary

    Fields
    Modifier and Type Field Description
    private T[] arr  
    private int i  
  • Constructor Summary

    Constructors
    Constructor Description
    stl_ArrItr​(T[] arr)  
  • Method Summary

    Modifier and Type Method Description
    boolean hasNext()  
    T 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

    forEachRemaining, remove
  • Field Details

    • arr

      private final T[] arr
    • i

      private int i
  • Constructor Details

    • stl_ArrItr

      public stl_ArrItr​(T[] arr)
      Parameters:
      arr - The target primitive array.
  • Method Details

    • hasNext

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

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