Class Arrays.Iterator<T>

  • All Implemented Interfaces:
    Iterator<T>
    Enclosing class:
    Arrays

    public static class Arrays.Iterator<T>
    extends Object
    implements Iterator<T>
    Iterator backed by a specific array.
    • Constructor Detail

      • Iterator

        public Iterator​(T[] dataArray)
        Base constructor.

        Note: the array is not cloned, changes to it will affect the values returned by next().

        Parameters:
        dataArray - array backing the iterator.
    • Method Detail

      • hasNext

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

        public T next()
        Specified by:
        next in interface Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<T>