final class OffsetQuantity[N, U] extends AnyVal with Serializable
A quantity with a unit associated with an additional offset
- N
The value type (Double, Int, etc)
- U
The unit type (Celsius, Second, etc)
- Alphabetic
- By Inheritance
- OffsetQuantity
- Serializable
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def +[N2, U2](rhs: Quantity[N2, U2])(implicit ua: UnitAdd[N, U, N2, U2]): OffsetQuantity[N, U]
Add a quantity to this offset-quantity
Add a quantity to this offset-quantity
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the sum.
- returns
this+rhs, expressed in units (N,U).
- def -[N2, U2](rhs: Quantity[N2, U2])(implicit us: UnitSub[N, U, N2, U2]): OffsetQuantity[N, U]
Subtract a quantity from this offset-quantity
Subtract a quantity from this offset-quantity
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the difference.
- returns
this-rhs, expressed in units (N,U).
- def -[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit sub: OffsetUnitSub[N, U, N2, U2]): Quantity[N, U]
Compute the difference of two offset-units
Compute the difference of two offset-units
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand operand in the difference.
- returns
result of this-rhs, expressed in units (N,U).
- def <[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit uc: OffsetUnitOrd[N, U, N2, U2]): Boolean
Test if this quantity is less than another
Test if this quantity is less than another
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the comparison.
- returns
true if this is less than the rhs (after conversion to types N,U), false otherwise
- def <=[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit uc: OffsetUnitOrd[N, U, N2, U2]): Boolean
Test if this quantity is less than or equal to another
Test if this quantity is less than or equal to another
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the comparison.
- returns
true if this is less than or equal to the rhs (after conversion to types N,U), false otherwise
- def =!=[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit uc: OffsetUnitOrd[N, U, N2, U2]): Boolean
Test if two quantities are not equal
Test if two quantities are not equal
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the comparison.
- returns
true if rhs is not equal to this (after conversion to types N,U), false otherwise
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def ===[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit uc: OffsetUnitOrd[N, U, N2, U2]): Boolean
Test if two offset-quantities are equal
Test if two offset-quantities are equal
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the comparison.
- returns
true if rhs is equal to this (after conversion to types N,U), false otherwise
- def >[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit uc: OffsetUnitOrd[N, U, N2, U2]): Boolean
Test if this quantity is greater than another
Test if this quantity is greater than another
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the comparison.
- returns
true if this is greater than the rhs (after conversion to types N,U), false otherwise
- def >=[N2, U2](rhs: OffsetQuantity[N2, U2])(implicit uc: OffsetUnitOrd[N, U, N2, U2]): Boolean
Test if this quantity is greater than or equal to another
Test if this quantity is greater than or equal to another
- N2
the value type of the rhs
- U2
the unit type of the rhs. Must be convertable to U, or a compile-time type error will result.
- rhs
the right hand of the comparison.
- returns
true if this is greater than or equal to the rhs (after conversion to types N,U), false otherwise
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def show(implicit ustr: UnitString[U]): String
A string representation of this offset-quantity, using unit abbreviations
- def showFull(implicit ustr: UnitString[U]): String
A string representation of this offset-quantity, using full unit names
- def showUnit(implicit ustr: UnitString[U]): String
A string representation of this offset-quantity's associated unit, using abbreviations
- def showUnitFull(implicit ustr: UnitString[U]): String
A String representation of this offset-quantity's associated unit, using full names
- def to[N2, U2](implicit uc: OffsetUnitConverter[N, U, N2, U2]): OffsetQuantity[N2, U2]
Equivalent to this.toUnit[U2].toValue[N2]
Equivalent to this.toUnit[U2].toValue[N2]
- N2
the value type to convert to.
- U2
the new units to convert to. Must be convertable to U, or a compile-time type error will result.
- returns
an offset-quantity equivalent to this but with value type N2 and units U2
- def toString(): String
- Definition Classes
- OffsetQuantity → Any
- def toUnit[U2](implicit uc: OffsetUnitConverter[N, U, N, U2]): OffsetQuantity[N, U2]
Obtain an offset-quantity that is equivalent to this but with different compatible units
Obtain an offset-quantity that is equivalent to this but with different compatible units
- U2
the new units to convert to. Must be convertable to U, or a compile-time type error will result.
- returns
the offset quantity equivalent to this, but with units U2
- def toValue[N2](implicit uc: OffsetUnitConverter[N, U, N2, U]): OffsetQuantity[N2, U]
Obtain an offset-quantity equivalent to this but with a different value type
Obtain an offset-quantity equivalent to this but with a different value type
- N2
the value type to convert to.
- returns
an offset-quantity equivalent to this but with value type N2 and units U
- val value: N