RandomIterator

com.phasmidsoftware.gryphon.util.RandomIterator
See theRandomIterator companion class

An object providing utility methods for creating and working with RandomIterator.

The RandomIterator is used to iterate over a collection of elements in a random order.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[T](iterator: Iterator[T])(implicit random: Random): RandomIterator[T]

Creates a RandomIterator that iterates over the elements of the provided Iterator in random order.

Creates a RandomIterator that iterates over the elements of the provided Iterator in random order.

Value parameters

iterator

the Iterator containing the elements to be iterated in random order.

random

an implicit Random instance used to determine the random order of iteration.

Attributes

Returns

a RandomIterator containing the elements of the input Iterator shuffled randomly.