Units

abstract class Units(val suffix: String, val ratio: Double = 1.0)(source)

Base class for all types that can represent a unit of measure. A Units type can have multiple "members", each being some fraction of the base unit for that type. Time for example, might have seconds as the base unit and minute as a unit that is 60 times the base unit. This allows for a set of different representations of the unit.

Parameters

suffix

to use when printing the unit in a human readable way

ratio

of this unit relative to the base-unit

Inheritors

Constructors

Link copied to clipboard
constructor(suffix: String, ratio: Double = 1.0)

Properties

Link copied to clipboard
val ratio: Double = 1.0
Link copied to clipboard

Functions

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 override fun toString(): String