StrictlyNegativeInt

@SinceKotoolsTypes(version = "1.1")
value class StrictlyNegativeInt constructor(val value: Int) : Comparable<StrictlyNegativeInt>

Represents strictly negative integers, excluding 0.

Constructors

Link copied to clipboard

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

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
@SinceKotoolsTypes(version = "1.3")
infix operator fun compareTo(other: Int): Int
@SinceKotoolsTypes(version = "1.3")
infix operator fun compareTo(other: NegativeInt): Int
@SinceKotoolsTypes(version = "1.3")
infix operator fun compareTo(other: NonZeroInt): Int
open infix operator override fun compareTo(other: StrictlyNegativeInt): Int

Compares this value with the other value for order. Returns 0 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.

@SinceKotoolsTypes(version = "1.3")
infix operator fun compareTo(other: PositiveInt): Int
@SinceKotoolsTypes(version = "1.3")
infix operator fun compareTo(other: StrictlyPositiveInt): Int

Compares this value with the other value and returns a negative number for order.

Link copied to clipboard
operator fun dec(): StrictlyNegativeInt

Returns this value decremented by 1. If this value is the minimum, it returns the maximum value instead.

Link copied to clipboard
infix operator fun div(other: Int): Int
infix operator fun div(other: NegativeInt): PositiveInt
infix operator fun div(other: PositiveInt): NegativeInt

Divides this value by the other value, truncating the result to an integer that is closer to 0. Throws an ArithmeticException if the other value equals 0.

infix operator fun div(other: NonZeroInt): Int
infix operator fun div(other: StrictlyNegativeInt): PositiveInt
infix operator fun div(other: StrictlyPositiveInt): NegativeInt

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

Link copied to clipboard
operator fun inc(): StrictlyNegativeInt

Returns this value incremented by 1. If this value is the maximum, it returns the minimum value instead.

Link copied to clipboard
infix operator fun minus(other: Int): Int
infix operator fun minus(other: NegativeInt): Int
infix operator fun minus(other: NonZeroInt): Int
infix operator fun minus(other: PositiveInt): StrictlyNegativeInt
infix operator fun minus(other: StrictlyNegativeInt): Int
infix operator fun minus(other: StrictlyPositiveInt): StrictlyNegativeInt

Subtracts the other value from this value.

Link copied to clipboard
infix operator fun plus(other: Int): Int
infix operator fun plus(other: NegativeInt): StrictlyNegativeInt
infix operator fun plus(other: NonZeroInt): Int
infix operator fun plus(other: PositiveInt): Int
infix operator fun plus(other: StrictlyNegativeInt): StrictlyNegativeInt
infix operator fun plus(other: StrictlyPositiveInt): Int

Adds the other value to this value.

Link copied to clipboard
infix operator fun times(other: Int): Int
infix operator fun times(other: NegativeInt): PositiveInt
infix operator fun times(other: NonZeroInt): NonZeroInt
infix operator fun times(other: PositiveInt): NegativeInt
infix operator fun times(other: StrictlyNegativeInt): StrictlyPositiveInt
infix operator fun times(other: StrictlyPositiveInt): StrictlyNegativeInt

Multiplies this value by the other value.

Link copied to clipboard

Returns this value as a negative int.

Link copied to clipboard

Returns this value as a non-zero int.

Link copied to clipboard
@SinceKotoolsTypes(version = "1.2")
fun toNotBlankString(): NotBlankString

Returns the string representation of this value as a not blank string.

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

Returns the negative of this value.

Link copied to clipboard

Returns this value.

Properties

Link copied to clipboard
val value: Int