Object Iterables

  • All Implemented Interfaces:

    
    public class Iterables
    
                        

    Utilities that extend the functionality of Iterable.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Iterables INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final <R extends Any> Iterable<R> shuffled(Iterable<R> $self, RandomGenerator randomGenerator) Fisher–Yates shuffle algorithm using a RandomGenerator.
      final <R extends Any> R randomElement(Iterable<R> $self, RandomGenerator randomGenerator) Returns a random element of the Iterable using the provided randomGenerator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • shuffled

         final <R extends Any> Iterable<R> shuffled(Iterable<R> $self, RandomGenerator randomGenerator)

        Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.

        Parameters:
        randomGenerator -
        the simulation {@link RandomGenerator}.