Package-level declarations

Contains types such as NonZeroInt for manipulating numbers.

Types

Link copied to clipboard

Parent of classes responsible for holding integers.

Link copied to clipboard
interface IntHolderDsl<out T : IntHolder>

Context responsible for building an IntHolder.

Link copied to clipboard
@Serializable(with = NegativeIntSerializer::class)
interface NegativeInt : IntHolder

Representation of negative integers, including zero.

Link copied to clipboard
@Serializable(with = NonZeroIntSerializer::class)
interface NonZeroInt : IntHolder

Representation of integers other than zero.

Link copied to clipboard
@Serializable(with = PositiveIntSerializer::class)
interface PositiveInt : IntHolder

Representation of positive integers, including zero.

Link copied to clipboard
@Serializable(with = StrictlyNegativeIntSerializer::class)
interface StrictlyNegativeInt : NonZeroInt, NegativeInt

Representation of strictly negative integers, excluding zero.

Link copied to clipboard
@Serializable(with = StrictlyPositiveIntSerializer::class)
interface StrictlyPositiveInt : NonZeroInt, PositiveInt

Representation of strictly positive integers, excluding zero.

Functions

Link copied to clipboard
operator fun Int.compareTo(other: IntHolder): Int

Compares this value with the other value for order. Returns zero if this value equals the other value, a negative number if this value is less than the other value, or a positive number if this value is greater than the other value.

Link copied to clipboard
operator fun Int.div(other: NonZeroInt): Int

Divides this value by the other value, truncating the result to an integer that is closer to zero.

Link copied to clipboard
operator fun Int.minus(other: IntHolder): Int

Subtracts the other value from this value.

Link copied to clipboard

Returns the value as a NegativeInt, or throws an NegativeInt.ConstructionError if the value is strictly positive.

Link copied to clipboard

Returns the value as a NegativeInt, or returns null if the value is strictly positive.

Link copied to clipboard

Returns the value as a NegativeInt, or throws an IllegalArgumentException if the value is strictly positive.

Link copied to clipboard

Returns the value as a NonZeroInt, or throws an NonZeroInt.ConstructionError if the value equals zero.

Link copied to clipboard

Returns the value as a NonZeroInt, or returns null if the value equals zero.

Link copied to clipboard

Returns the value as a NonZeroInt, or throws an IllegalArgumentException if the value equals zero.

Link copied to clipboard
operator fun Int.plus(other: IntHolder): Int

Adds the other value to this value.

Link copied to clipboard

Returns the value as a PositiveInt, or throws an PositiveInt.ConstructionError if the value is strictly negative.

Link copied to clipboard

Returns the value as a PositiveInt, or returns null if the value is strictly negative.

Link copied to clipboard

Returns the value as a PositiveInt, or throws an IllegalArgumentException if the value is strictly negative.

Link copied to clipboard

Returns a random NegativeInt.

Link copied to clipboard

Returns a random NonZeroInt.

Link copied to clipboard

Returns a random PositiveInt.

Link copied to clipboard
Link copied to clipboard

Returns the value as a StrictlyNegativeInt, or returns null if the value is positive.

Link copied to clipboard

Returns the value as a StrictlyNegativeInt, or throws an IllegalArgumentException if the value is positive.

Link copied to clipboard
Link copied to clipboard

Returns the value as a StrictlyPositiveInt, or returns null if the value is negative.

Link copied to clipboard

Returns the value as a StrictlyPositiveInt, or throws an IllegalArgumentException if the value is negative.

Link copied to clipboard
operator fun Int.times(other: IntHolder): Int

Multiplies this value by the other value.

Link copied to clipboard

Returns this value as a NegativeInt, or throws an NegativeInt.ConstructionError if this value is strictly positive.

Link copied to clipboard

Returns this value as a NegativeInt, or returns null if this value is strictly positive.

Link copied to clipboard

Returns this value as a NegativeInt, or throws an IllegalArgumentException if this value is strictly positive.

Link copied to clipboard

Returns this value as a NonZeroInt, or throws an NonZeroInt.ConstructionError if this value equals zero.

Link copied to clipboard

Returns this value as a NonZeroInt, or returns null if this value equals zero.

Link copied to clipboard

Returns this value as a NonZeroInt, or throws a IllegalArgumentException if this value equals zero.

Link copied to clipboard

Returns this value as a PositiveInt, or throws an PositiveInt.ConstructionError if this value is strictly negative.

Link copied to clipboard

Returns this value as a PositiveInt, or returns null if this value is strictly negative.

Link copied to clipboard

Returns this value as a PositiveInt, or throws an IllegalArgumentException if this value is strictly negative.

Link copied to clipboard

Returns this value as a StrictlyNegativeInt, or throws an StrictlyNegativeInt.ConstructionError if this value is positive.

Link copied to clipboard

Returns this value as a StrictlyNegativeInt, or returns null if this value is positive.

Link copied to clipboard

Returns this value as a StrictlyNegativeInt, or throws an IllegalArgumentException if this value is positive.

Link copied to clipboard

Returns this value as a StrictlyPositiveInt, or throws an StrictlyPositiveInt.ConstructionError if this value is negative.

Link copied to clipboard

Returns this value as a StrictlyPositiveInt, or returns null if this value is negative.

Link copied to clipboard

Returns this value as a StrictlyPositiveInt, or throws an IllegalArgumentException if this value is negative.

Properties

Link copied to clipboard

Context responsible for building a NegativeInt.

Link copied to clipboard

Context responsible for building a NonZeroInt.

Link copied to clipboard

Context responsible for building a PositiveInt.

Link copied to clipboard

Context responsible for building a StrictlyNegativeInt.

Link copied to clipboard

Context responsible for building a StrictlyPositiveInt.