Packages

c

squants

Quantity

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

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Quantity
  2. Ordered
  3. Comparable
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Quantity()

Abstract Value Members

  1. abstract def dimension: Dimension[A]

    The Dimension this quantity represents

  2. abstract def unit: UnitOfMeasure[A]

    The Unit of Measure the value represents

    The Unit of Measure the value represents

    returns

    UnitOfMeasure[A]

  3. abstract def value: Double

    The value of the quantity given the unit

    The value of the quantity given the unit

    returns

    Double

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def %(that: A): Double
  4. def %(that: Double): A
  5. def *(that: Double): A
  6. def +(that: A): A
  7. def +-(that: A): QuantityRange[A]
  8. def -(that: A): A
  9. def /(that: A): Double
  10. def /(that: Double): A
  11. def /%(that: A): (Double, A)
  12. def /%(that: Double): (A, A)
  13. def <(that: A): Boolean
    Definition Classes
    Ordered
  14. def <=(that: A): Boolean
    Definition Classes
    Ordered
  15. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def =~(that: A)(implicit tolerance: A): Boolean

    approx

  17. def >(that: A): Boolean
    Definition Classes
    Ordered
  18. def >=(that: A): Boolean
    Definition Classes
    Ordered
  19. def abs: A

    Returns the absolute value of this Quantity

    Returns the absolute value of this Quantity

    returns

    Quantity

  20. 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

  21. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  22. def ceil: A

    Returns the smallest (closest to negative infinity) Quantity value that is greater than or equal to the argument and is equal to a mathematical integer.

    Returns the smallest (closest to negative infinity) Quantity value that is greater than or equal to the argument and is equal to a mathematical integer.

    returns

    Quantity

    See also

    java.lang.Math#ceil(double)

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

    Implements Ordered.compare

    Implements Ordered.compare

    that

    Quantity

    returns

    Int

    Definition Classes
    Quantity → Ordered
  25. def compareTo(that: A): Int
    Definition Classes
    Ordered → Comparable
  26. def divide(that: A): Double

    Divide this quantity by a like quantity

    Divide this quantity by a like quantity

    that

    Quantity

    returns

    Double

  27. def divide(that: Double): A

    Divide this quantity by some number

    Divide this quantity by some number

    that

    Double

    returns

    Quantity

  28. 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)

  29. 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)

  30. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def equals(that: Any): Boolean

    Override of equals method

    Override of equals method

    that

    must be of matching value and unit

    Definition Classes
    Quantity → AnyRef → Any
  32. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. def floor: A

    Returns the largest (closest to positive infinity) Quantity value that is less than or equal to the argument and is equal to a mathematical integer

    Returns the largest (closest to positive infinity) Quantity value that is less than or equal to the argument and is equal to a mathematical integer

    returns

    Quantity

    See also

    java.lang.Math#floor(double)

  34. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  35. def hashCode(): Int

    Override of hashCode

    Override of hashCode

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

    Returns an equivalent Quantity boxed with the supplied Unit

    Returns an equivalent Quantity boxed with the supplied Unit

    uom

    UnitOfMeasure[A]

    returns

    Quantity

  37. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  38. def map(f: (Double) ⇒ Double): A

    Applies a function to the underlying value of the Quantity, returning a new Quantity in the same unit

    Applies a function to the underlying value of the Quantity, returning a new Quantity in the same unit

    f

    Double => Double function

  39. 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

  40. 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

  41. def minus(that: A): A

    Subtract two like quantities

    Subtract two like quantities

    that

    Quantity

    returns

    Quantity

  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. def negate: A

    Returns the negative value of this Quantity

    Returns the negative value of this Quantity

    returns

    Quantity

  44. 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

  45. final def notify(): Unit
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  47. def plus(that: A): A

    Add two like quantities

    Add two like quantities

    that

    Quantity

    returns

    Quantity

  48. 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

  49. 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

  50. 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

  51. def rint: A

    Returns the Quantity value that is closest in value to the argument and is equal to a mathematical integer.

    Returns the Quantity value that is closest in value to the argument and is equal to a mathematical integer.

    returns

    Quantity

    See also

    java.lang.Math#rint(double)

  52. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  53. def times(that: Double): A

    Multiply this quantity by some number

    Multiply this quantity by some number

    that

    Double

    returns

    Quantity

  54. def to(uom: 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)
    uom

    UnitOfMeasure[A]

    returns

    Double

  55. 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

  56. def toString(uom: UnitOfMeasure[A], format: String): String

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

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

    uom

    UnitOfMeasure[A] with UnitConverter

    format

    String containing the format for the value (ie "%.3f")

    returns

    String

  57. def toString(uom: 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

    uom

    UnitOfMeasure[A] with UnitConverter

    returns

    String

  58. def toString(): String

    Returns a string representing the quantity's value in unit

    Returns a string representing the quantity's value in unit

    returns

    String

    Definition Classes
    Quantity → AnyRef → Any
  59. def toTuple(uom: UnitOfMeasure[A]): (Double, String)

    Returns a pair representing the numeric value and the uom's symbol

    Returns a pair representing the numeric value and the uom's symbol

    uom

    UnitOfMeasure[A]

  60. def toTuple: (Double, String)

    Returns a tuple representing the numeric value and the unit's symbol

  61. def unary_-(): A
  62. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. 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

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

    approx

  67. def (that: A)(implicit tolerance: A): Boolean

    approx

Inherited from Ordered[A]

Inherited from Comparable[A]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped