Class ArrayIterator

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Iterator

    public class ArrayIterator
    extends java.lang.Object
    implements java.util.Iterator, java.io.Serializable, java.lang.Cloneable
    An array iterator.
    Version:
    $Revision$
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object[] array
      Array to iterate over.
      protected int index
      The current position in the array.
      private static long serialVersionUID
      The serialVersionUID
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayIterator​(java.lang.Object[] array)
      Construct an ArrayIterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns a shallow cloned copy of this object.
      boolean hasNext()
      Returns true if there are more elements in the iteration.
      java.lang.Object next()
      Returns the next element in the iteration.
      void remove()
      Unsupported.
      • Methods inherited from class java.lang.Object

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

        forEachRemaining
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        The serialVersionUID
        See Also:
        Constant Field Values
      • array

        protected final java.lang.Object[] array
        Array to iterate over.
      • index

        protected int index
        The current position in the array.
    • Constructor Detail

      • ArrayIterator

        public ArrayIterator​(java.lang.Object[] array)
        Construct an ArrayIterator.
        Parameters:
        array - The array to iterate over.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Returns true if there are more elements in the iteration.
        Specified by:
        hasNext in interface java.util.Iterator
        Returns:
        True if there are more elements in the iteration.
      • next

        public java.lang.Object next()
        Returns the next element in the iteration.
        Specified by:
        next in interface java.util.Iterator
        Returns:
        The next element in the iteration.
        Throws:
        java.util.NoSuchElementException - The are no more elements available.
      • remove

        public void remove()
        Unsupported.
        Specified by:
        remove in interface java.util.Iterator
        Throws:
        java.lang.UnsupportedOperationException
      • clone

        public java.lang.Object clone()
        Returns a shallow cloned copy of this object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        A shallow cloned copy of this object.