Class IterableArray<E>

  • Type Parameters:
    E - the element type of the underlying array
    All Implemented Interfaces:
    java.lang.Iterable<E>

    public class IterableArray<E>
    extends java.lang.Object
    implements java.lang.Iterable<E>
    An iterable over an array of elements.
    • Constructor Summary

      Constructors 
      Constructor Description
      IterableArray​(E[] array)
      Builds the iterable.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      java.util.Iterator<E> iterator()  
      int size()
      Yields the size of this iterable, that is, the length of the array behind this iterable.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

        forEach, spliterator
    • Constructor Detail

      • IterableArray

        public IterableArray​(E[] array)
        Builds the iterable.
        Parameters:
        array - the underlying array
    • Method Detail

      • size

        public int size()
        Yields the size of this iterable, that is, the length of the array behind this iterable.
        Returns:
        the size
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

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

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