Class ArrayIterable<E>

  • Type Parameters:
    E - the type of elements returned by the iterable's iterator
    All Implemented Interfaces:
    java.lang.Iterable<E>

    public class ArrayIterable<E>
    extends java.lang.Object
    implements java.lang.Iterable<E>
    An ArrayIterable provides an Iterable for an array of objects of type E.
    See Also:
    ArrayIterator, ArrayListIterable
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayIterable​(E... array)
      Construct an iterable for the specified array.
      ArrayIterable​(E[] array, int start)
      Construct an iterable for the specified array, starting at the specified start index and continuing for the rest of the array.
      ArrayIterable​(E[] array, int start, int length)
      Construct an iterable for the specified array, starting at the specified start index and continuing for the specified length.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<E> iterator()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • ArrayIterable

        public ArrayIterable​(E... array)
        Construct an iterable for the specified array.
      • ArrayIterable

        public ArrayIterable​(E[] array,
                             int start)
        Construct an iterable for the specified array, starting at the specified start index and continuing for the rest of the array.
      • ArrayIterable

        public ArrayIterable​(E[] array,
                             int start,
                             int length)
        Construct an iterable for the specified array, starting at the specified start index and continuing for the specified length.
    • Method Detail

      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<E>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object