Scoop API

scoop:scoop.std:0.1.0

Duration

class Duration

source · line 9
public
public class Duration private constructor(
    /**
     * The whole-second component rounded toward negative infinity.
     */
    public val floorSeconds: Long,
    /**
     * The nonnegative fractional component in 0..999999999.
     */
    public val nanosecondsOfSecond: Int
) : Equals<Duration>, Compare<Duration>, Hash, ToString, Add<Duration, Duration>, Sub<
    Duration,
    Duration
>, Mul<Long, Duration>, Div<Long, Duration>, UnaryMinus<Duration>

A signed elapsed duration with nanosecond precision, normalized as floor seconds plus nonnegative fractional nanoseconds. Arithmetic throws on representational overflow.

function toComponents

source · line 138
public
public fun toComponents(): (Long, Int)

Returns whole seconds truncated toward zero and a signed nanosecond remainder.

function hash

source · line 40
public
public override fun hash(): Long

Computes a hash consistent with component equality.

function div

source · line 85
public
public override operator fun div(other: Long): Duration

Divides by a signed integer, truncating subnanosecond remainder toward zero; zero divisor or overflow throws.

property inWholeHours

source · line 113
public
public val inWholeHours: Long

get: public read-only

Returns whole hours truncated toward zero; a result outside Long range throws ArithmeticException.

property nanosecondsOfSecond

source · line 17
public
public val nanosecondsOfSecond: Int

get: public read-only

The nonnegative fractional component in 0..999999999.

property inWholeDays

source · line 118
public
public val inWholeDays: Long

get: public read-only

Returns whole days truncated toward zero; a result outside Long range throws ArithmeticException.

function toIsoString

source · line 149
public
public fun toIsoString(): String

Formats the signed duration in ISO duration notation.

property floorSeconds

source · line 13
public
public val floorSeconds: Long

get: public read-only

The whole-second component rounded toward negative infinity.

property inWholeMicroseconds

source · line 128
public
public val inWholeMicroseconds: Long

get: public read-only

Returns whole microseconds truncated toward zero; a result outside Long range throws ArithmeticException.

property inWholeMinutes

source · line 108
public
public val inWholeMinutes: Long

get: public read-only

Returns whole minutes truncated toward zero; a result outside Long range throws ArithmeticException.

property inWholeNanoseconds

source · line 133
public
public val inWholeNanoseconds: Long

get: public read-only

Returns whole nanoseconds truncated toward zero; a result outside Long range throws ArithmeticException.

property inWholeMilliseconds

source · line 123
public
public val inWholeMilliseconds: Long

get: public read-only

Returns whole milliseconds truncated toward zero; a result outside Long range throws ArithmeticException.

property inWholeSeconds

source · line 99
public
public val inWholeSeconds: Long

get: public read-only

Returns whole seconds truncated toward zero; a result outside Long range throws ArithmeticException.

function unaryMinus

source · line 74
public
public override operator fun unaryMinus(): Duration

Negates the duration, throwing if the result cannot be represented.