squants

Quantity

abstract class Quantity[A <: Quantity[A]] extends Ordered[A] with Serializable

A base trait for measurable quantities

Self Type
A
Since

0.1

Linear Supertypes
Serializable, Serializable, Ordered[A], Comparable[A], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Quantity
  2. Serializable
  3. Serializable
  4. Ordered
  5. Comparable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Quantity()

Abstract Value Members

  1. abstract def value: Double

    The value of the quantity given the valueUnits

    The value of the quantity given the valueUnits

    returns

    Double

  2. abstract def valueUnit: UnitOfMeasure[A]

    The Unit of Measure used for the quantity's underlying value

    The Unit of Measure used for the quantity's underlying value

    returns

    UnitOfMeasure[A]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def %(that: A): Double

  5. def %(that: Double): A

  6. def *(that: Double): A

  7. def +(that: A): A

  8. def +-(that: A): QuantityRange[A]

  9. def -(that: A): A

  10. def /(that: A): Double

  11. def /(that: Double): A

  12. def /%(that: A): (Double, A)

  13. def /%(that: Double): (A, A)

  14. def <(that: A): Boolean

    Definition Classes
    Ordered
  15. def <=(that: A): Boolean

    Definition Classes
    Ordered
  16. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  18. def =~(that: A)(implicit tolerance: A): Boolean

    approx

  19. def >(that: A): Boolean

    Definition Classes
    Ordered
  20. def >=(that: A): Boolean

    Definition Classes
    Ordered
  21. def abs: A

    Returns the absolute value of this Quantity

    Returns the absolute value of this Quantity

    returns

    Quantity

  22. def approx(that: A)(implicit tolerance: A): Boolean

    Returns boolean result of approximate equality comparison

    Returns boolean result of approximate equality comparison

    that

    Quantity

    tolerance

    Quantity

    returns

  23. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  24. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def compare(that: A): Int

    Implements Ordered.

    Implements Ordered.compare

    that

    Quantity

    returns

    Int

    Definition Classes
    Quantity → Ordered
  26. def compareTo(that: A): Int

    Definition Classes
    Ordered → Comparable
  27. def divide(that: A): Double

    Divide this quantity by a like quantity

    Divide this quantity by a like quantity

    that

    Quantity

    returns

    Double

  28. def divide(that: Double): A

    Divide this quantity by some number

    Divide this quantity by some number

    that

    Double

    returns

    Quantity

  29. def divideAndRemainder(that: A): (Double, A)

    Returns a Pair that includes the result of divideToInteger and remainder

    Returns a Pair that includes the result of divideToInteger and remainder

    that

    Quantity

    returns

    (Double, Quantity)

  30. def divideAndRemainder(that: Double): (A, A)

    Returns a Pair that includes the result of divideToInteger and remainder

    Returns a Pair that includes the result of divideToInteger and remainder

    that

    Double

    returns

    (Quantity, Quantity)

  31. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. def equals(that: Any): Boolean

    Override of equals method

    Override of equals method

    that

    must be of matching value and unit

    returns

    Definition Classes
    Quantity → AnyRef → Any
  33. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  35. def hashCode(): Int

    Override of hashCode

    Override of hashCode

    returns

    Definition Classes
    Quantity → AnyRef → Any
  36. def in(unit: UnitOfMeasure[A]): A

    Returns an equivalent Quantity boxed with the supplied Unit

    Returns an equivalent Quantity boxed with the supplied Unit

    This is really only useful for Quantity classes that box at the UOM level e.g. Temperature and currently Time

    unit

    UnitOfMeasure[A]

    returns

    Quantity

  37. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  38. def max(that: A): A

    Returns the max of this and that Quantity

    Returns the max of this and that Quantity

    that

    Quantity

    returns

    Quantity

  39. def min(that: A): A

    Returns the min of this and that Quantity

    Returns the min of this and that Quantity

    that

    Quantity

    returns

    Quantity

  40. def minus(that: A): A

    Subtract two like quantities

    Subtract two like quantities

    that

    Quantity

    returns

    Quantity

  41. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  42. def negate: A

    Returns the negative value of this Quantity

    Returns the negative value of this Quantity

    returns

    Quantity

  43. def notWithin(range: QuantityRange[A]): Boolean

    Returns true if this value is not within (contains) the range

    Returns true if this value is not within (contains) the range

    range

    QuantityRange

    returns

    Boolean

  44. final def notify(): Unit

    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  46. def plus(that: A): A

    Add two like quantities

    Add two like quantities

    that

    Quantity

    returns

    Quantity

  47. def plusOrMinus(that: A): QuantityRange[A]

    Returns a QuantityRange representing the range for this value +- that

    Returns a QuantityRange representing the range for this value +- that

    that

    Quantity

    returns

    QuantityRange

  48. def remainder(that: A): Double

    Returns the remainder of a division by a like quantity

    Returns the remainder of a division by a like quantity

    that

    Quantity

    returns

    Double

  49. def remainder(that: Double): A

    Returns the remainder of a division by a number

    Returns the remainder of a division by a number

    that

    Quantity

    returns

    Quantity

  50. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  51. def times(that: Double): A

    Multiply this quantity by some number

    Multiply this quantity by some number

    that

    Double

    returns

    Quantity

  52. def to(unit: UnitOfMeasure[A]): Double

    Returns a Double representing the quantity in terms of the supplied unit

    Returns a Double representing the quantity in terms of the supplied unit

    val d = Feet(3)
    (d to Inches) should be(36)
    unit

    UnitOfMeasure[A]

    returns

    Double

  53. def to(that: A): QuantityRange[A]

    Returns a QuantityRange that goes from this to that

    Returns a QuantityRange that goes from this to that

    that

    Quantity

    returns

    QuantityRange

  54. def toString(unit: UnitOfMeasure[A]): String

    Returns a string representing the quantity's value in the given unit

    Returns a string representing the quantity's value in the given unit

    unit

    UnitOfMeasure[A] with UnitConverter

    returns

    String

  55. def toString(): String

    Returns a string representing the quantity's value in valueUnits

    Returns a string representing the quantity's value in valueUnits

    returns

    String

    Definition Classes
    Quantity → AnyRef → Any
  56. def unary_-(): A

  57. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. def within(range: QuantityRange[A]): Boolean

    Returns true if this value is within (contains) the range

    Returns true if this value is within (contains) the range

    range

    QuantityRange

    returns

    Boolean

  61. def ~=(that: A)(implicit tolerance: A): Boolean

    approx - more natural operator but has low precedence and requires parens

Inherited from Serializable

Inherited from Serializable

Inherited from Ordered[A]

Inherited from Comparable[A]

Inherited from AnyRef

Inherited from Any

Ungrouped