AbstractQuantityNumeric

abstract class AbstractQuantityNumeric[A <: Quantity[A]](val unit: UnitOfMeasure[A] & PrimaryUnit) extends Numeric[A]

Base class for creating objects to manage quantities as Numeric.

Base class for creating objects to manage quantities as Numeric.

One limitation is the times operation which is not supported by every quantity type

Type Params
A

Quantity type

trait Numeric[A]
trait Ordering[A]
trait PartialOrdering[A]
trait Equiv[A]
trait Serializable
trait Comparator[A]
class Object
trait Matchable
class Any

Type members

Inherited classlikes

class NumericOps
Inherited from
Numeric
Inherited from
Ordering

Value members

Concrete methods

def compare(x: A, y: A): Int
def fromInt(x: Int): A
def minus(x: A, y: A): A
def negate(x: A): A
def parseString(str: String): Option[A]
def plus(x: A, y: A): A
def times(x: A, y: A): A

times is not a supported Numeric operation for Quantities. It is not possible to multiply a dimensional quantity by a like quantity and get another like quantity. Applying this class in a way that uses this method will result in an UnsupportedOperationException being thrown.

times is not a supported Numeric operation for Quantities. It is not possible to multiply a dimensional quantity by a like quantity and get another like quantity. Applying this class in a way that uses this method will result in an UnsupportedOperationException being thrown.

Value Params
x

Quantity[A]

y

Quantity[A]

Throws
scala.UnsupportedOperationException

for most types

def toDouble(x: A): Double
def toFloat(x: A): Float
def toInt(x: A): Int
def toLong(x: A): Long

Inherited methods

def abs(x: A): A
Inherited from
Numeric
override def equiv(x: A, y: A): Boolean
Definition Classes
Ordering -> PartialOrdering -> Equiv
Inherited from
Ordering
override def gt(x: A, y: A): Boolean
Definition Classes
Ordering -> PartialOrdering
Inherited from
Ordering
override def gteq(x: A, y: A): Boolean
Definition Classes
Ordering -> PartialOrdering
Inherited from
Ordering
def isReverseOf(other: Ordering[_]): Boolean
Inherited from
Ordering
override def lt(x: A, y: A): Boolean
Definition Classes
Ordering -> PartialOrdering
Inherited from
Ordering
override def lteq(x: A, y: A): Boolean
Definition Classes
Ordering -> PartialOrdering
Inherited from
Ordering
def max[U <: A](x: U, y: U): U
Inherited from
Ordering
def min[U <: A](x: U, y: U): U
Inherited from
Ordering
def on[U](f: U => A): Ordering[U]
Inherited from
Ordering
def one: A
Inherited from
Numeric
def orElse(other: Ordering[A]): Ordering[A]
Inherited from
Ordering
def orElseBy[S](f: A => S)(ord: Ordering[S]): Ordering[A]
Inherited from
Ordering
override def reverse: Ordering[A]
Definition Classes
Ordering -> PartialOrdering
Inherited from
Ordering
def reversed(): Comparator[A]
Inherited from
Comparator
def sign(x: A): A
Inherited from
Numeric
def thenComparing[U <: Comparable[_ >: U <: `<FromJavaObject>`]](`x$0`: Function[_ >: T <: `<FromJavaObject>`, _ <: U]): Comparator[A]
Inherited from
Comparator
def thenComparing[U <: `<FromJavaObject>`](`x$0`: Function[_ >: T <: `<FromJavaObject>`, _ <: U], `x$1`: Comparator[_ >: U <: `<FromJavaObject>`]): Comparator[A]
Inherited from
Comparator
def thenComparing(`x$0`: Comparator[_ >: T <: `<FromJavaObject>`]): Comparator[A]
Inherited from
Comparator
def thenComparingDouble(`x$0`: ToDoubleFunction[_ >: T <: `<FromJavaObject>`]): Comparator[A]
Inherited from
Comparator
def thenComparingInt(`x$0`: ToIntFunction[_ >: T <: `<FromJavaObject>`]): Comparator[A]
Inherited from
Comparator
def thenComparingLong(`x$0`: ToLongFunction[_ >: T <: `<FromJavaObject>`]): Comparator[A]
Inherited from
Comparator
def tryCompare(x: A, y: A): Some[Int]
Inherited from
Ordering
def zero: A
Inherited from
Numeric

Deprecated and Inherited methods

@deprecated("use `sign` method instead", "2.13.0")
def signum(x: A): Int
Deprecated
Inherited from
Numeric

Concrete fields

Implicits

Inherited implicits

implicit def mkNumericOps(lhs: A): NumericOps
Inherited from
Numeric
implicit def mkOrderingOps(lhs: A): OrderingOps
Inherited from
Ordering