Class ArrayFlowUniverse<E>

  • All Implemented Interfaces:
    Iterable<E>, FlowUniverse<E>

    public class ArrayFlowUniverse<E>
    extends Object
    implements FlowUniverse<E>
    Provides an implementation of a flow universe, wrapping arrays.
    • Field Detail

      • elements

        protected final E[] elements
    • Constructor Detail

      • ArrayFlowUniverse

        public ArrayFlowUniverse​(E[] elements)
    • Method Detail

      • size

        public int size()
        Description copied from interface: FlowUniverse
        returns the number of elements of the universe.
        Specified by:
        size in interface FlowUniverse<E>
        Returns:
        the size of the universe.
      • toArray

        public E[] toArray()
        Description copied from interface: FlowUniverse
        returns the elements of the universe in form of an array.
        The returned array could be backed or not. If you want to be sure that it is unbacked, clone() it.
        Specified by:
        toArray in interface FlowUniverse<E>
        Returns:
        the elements of the universe.