Quantity

abstract class Quantity<T : Quantity<T>>

Represents a physical quantity

Author

BeepBot99

Parameters

T

the type of the quantity

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@get:JvmName(name = "abs")
val abs: T
Link copied to clipboard
val sign: Int
Link copied to clipboard
abstract val value: Double

The value of the quantity

Functions

Link copied to clipboard
operator fun compareTo(other: T): Int
Link copied to clipboard
operator fun div(other: T): Double
operator fun div(scalar: Double): T
operator fun div(scalar: Int): T
Link copied to clipboard
abstract operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun greaterThan(other: T): Boolean
Link copied to clipboard
Link copied to clipboard
abstract override fun hashCode(): Int
Link copied to clipboard
fun isNaN(): Boolean
Link copied to clipboard
fun lessThan(other: T): Boolean
Link copied to clipboard
Link copied to clipboard
operator fun minus(other: T): T
Link copied to clipboard
abstract fun newInstance(value: Double): T

Creates a new instance of the class with the given value

Link copied to clipboard
operator fun plus(other: T): T
Link copied to clipboard
operator fun rem(other: T): T
operator fun rem(divisor: Double): T
operator fun rem(divisor: Int): T
Link copied to clipboard
operator fun times(other: T): T
operator fun times(scalar: Double): T
operator fun times(scalar: Int): T
Link copied to clipboard
abstract override fun toString(): String
Link copied to clipboard
operator fun unaryMinus(): T
Link copied to clipboard
operator fun unaryPlus(): T