Explicit

class Explicit(val value: Long) : Seed

Represents an explicit seed with a specific long value.

Parameters

value

The value for the explicit seed.

Throws

if the value is negative.

Constructors

Link copied to clipboard
constructor(value: Long)

Properties

Link copied to clipboard
val value: Long

The underlying long value used for the seed. Must be non-negative.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Seed): Int

Compares this Seed object with another Seed object. Random seeds are considered equal to other Random seeds, while Explicit seeds are compared based on their values.

Link copied to clipboard
fun copy(seed: Long? = null): Seed

Creates a copy of the Seed object with an optional new value. If no value is provided, the current value is used.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open fun nextSeed(): Seed

Generates a new Seed object with an incremented value, if applicable. This is the default behavior for Explicit seeds, while Random seeds remain the same. Subclasses can override this method to provide different behavior.

Link copied to clipboard

Returns a kotlin.random.Random instance based on the value of this seed.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the Seed object. It indicates the type (Random or Explicit) and the underlying value.