Class CollectionFlowUniverse<E>

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

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

      • elements

        protected final Set<E> elements
    • Constructor Detail

      • CollectionFlowUniverse

        public CollectionFlowUniverse​(Collection<? extends 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.