Class ConcurrentRoundRobin<T>

java.lang.Object
dev.getelements.elements.rt.ConcurrentRoundRobin<T>
All Implemented Interfaces:
RoundRobin<T>, Iterable<T>

public class ConcurrentRoundRobin<T> extends Object implements RoundRobin<T>
  • Constructor Details

    • ConcurrentRoundRobin

      public ConcurrentRoundRobin(T[] objects, int size)
  • Method Details

    • set

      public T set(int index, T object)
      Description copied from interface: RoundRobin
      Sets the objects at the supplied index.
      Specified by:
      set in interface RoundRobin<T>
      Parameters:
      index - the index
      object - the object
    • get

      public T get(int index)
      Description copied from interface: RoundRobin
      Gets the specific object at that index.
      Specified by:
      get in interface RoundRobin<T>
      Parameters:
      index - the index
      Returns:
      the object
    • getNext

      public T getNext()
      Description copied from interface: RoundRobin
      Gets the next object in this RoundRobin
      Specified by:
      getNext in interface RoundRobin<T>
      Returns:
      the next object
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • stream

      public Stream<T> stream()
      Description copied from interface: RoundRobin
      Gets a Stream<T> from this RoundRobin<T>.
      Specified by:
      stream in interface RoundRobin<T>
      Returns:
      the Stream<T> of all elements