JavaRandomState

com.phasmidsoftware.lascala.random.JavaRandomState
case class JavaRandomState[T](n: Long, g: Long => T) extends RandomState[T]

A concrete implementation of RandomState based on the Java random number generator

Type parameters

T

the underlying type of this random state, i.e. the type of the result of calling get

Value parameters

g

the function which maps a Long value into a T

n

the random Long that characterizes this random state

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RandomState[T]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def get: T

Attributes

Returns

the value of this random state

def map[U](f: T => U): RandomState[U]

Method to map this random state into another random state

Method to map this random state into another random state

Type parameters

U

the underlying type of the resulting random state

Value parameters

f

the function to map a T value into a U value

Attributes

Returns

a new random state

def next: RandomState[T]

Attributes

Returns

the next random state in the pseudo-random series

Inherited methods

def flatMap[U](f: T => RandomState[U]): RandomState[U]

Method to flatMap this random state into another random state

Method to flatMap this random state into another random state

Type parameters

U

the underlying type of the resulting random state

Value parameters

f

the function to map a T value into a RandomState[U] value

Attributes

Returns

a new random state

Inherited from:
RandomState
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
def toStream: Stream[T]

Attributes

Returns

a stream of T values

Inherited from:
RandomState