Mass

final class Mass extends Quantity[Mass] with TimeIntegral[MassFlow]

Represents a quantity of Mass

Represents a quantity of Mass

Value Params
value

the value in the squants.mass.Grams

Authors

garyKeorkunian

Since

0.1

Companion
object
class Quantity[Mass]
trait Ordered[Mass]
trait Comparable[Mass]
trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def *(that: SpecificEnergy): Energy
def *(that: Velocity): Momentum
def *(that: Acceleration): Force
def /(that: Density): Volume
def /(that: Volume): Density
def /(that: AreaDensity): Area
def /(that: Area): AreaDensity

Moment of inertia of a point mass with with this mass and the given radius from the center of rotation

Moment of inertia of a point mass with with this mass and the given radius from the center of rotation

Value Params
radius

length to center of rotation

Returns

moment of inertia of a point mass with given mass and radius

def toCarats: Double
def toEeV: Double
def toGeV: Double
def toGrams: Double
def toKilograms: Double
def toKilopounds: Double
def toMeV: Double
def toMegapounds: Double
def toMicrograms: Double
def toMilligrams: Double
def toNanograms: Double
def toOunces: Double
def toPeV: Double
def toPennyweights: Double
def toPounds: Double
def toSolarMasses: Double
def toStone: Double
def toTeV: Double
def toTolas: Double
def toTonnes: Double
def toTroyGrains: Double
def toTroyOunces: Double
def toTroyPounds: Double
def toeV: Double
def tokeV: Double
def tomeV: Double

Inherited methods

def %(that: Mass): Double
Inherited from
Quantity
def %(that: Double): Mass
Inherited from
Quantity
def *(that: Frequency): MassFlow

Returns the Time Derivative of this Quantity based on the Frequency this Quantity occurs

Returns the Time Derivative of this Quantity based on the Frequency this Quantity occurs

Value Params
that

Frequency - the rate at which this Quantity occurs

Inherited from
TimeIntegral
def *(that: Price[Mass]): Money
Inherited from
Quantity
def *(that: Double): Mass
Inherited from
Quantity
def +(that: Mass): Mass
Inherited from
Quantity
def +-(that: Mass): QuantityRange[Mass]
Inherited from
Quantity
def -(that: Mass): Mass
Inherited from
Quantity
def /(that: MassFlow): Time

Returns the amount time required to achieve the given change in the Derivative

Returns the amount time required to achieve the given change in the Derivative

Value Params
that

Derivative

Inherited from
TimeIntegral
def /(that: Time): MassFlow

Returns the Time Derivative which represents a change of the underlying quantity equal to this quantity over the given time.

Returns the Time Derivative which represents a change of the underlying quantity equal to this quantity over the given time.

Value Params
that

Time

Inherited from
TimeIntegral
def /(that: Mass): Double
Inherited from
Quantity
def /(that: Double): Mass
Inherited from
Quantity
def /%(that: Mass): (Double, Mass)
Inherited from
Quantity
def /%(that: Double): (Mass, Mass)
Inherited from
Quantity
def <(that: Mass): Boolean
Inherited from
Ordered
def <=(that: Mass): Boolean
Inherited from
Ordered
def =~(that: Mass)(tolerance: Mass): Boolean

approx

approx

Inherited from
Quantity
def >(that: Mass): Boolean
Inherited from
Ordered
def >=(that: Mass): Boolean
Inherited from
Ordered
def abs: Mass

Returns the absolute value of this Quantity

Returns the absolute value of this Quantity

Returns

Quantity

Inherited from
Quantity
def approx(that: Mass)(tolerance: Mass): Boolean

Returns boolean result of approximate equality comparison

Returns boolean result of approximate equality comparison

Value Params
that

Quantity

tolerance

Quantity

Inherited from
Quantity
def ceil: Mass

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)

Inherited from
Quantity
def compare(that: Mass): Int

Implements Ordered.compare

Implements Ordered.compare

Value Params
that

Quantity

Returns

Int

Inherited from
Quantity
def compareTo(that: Mass): Int
Inherited from
Ordered
def divide(that: Mass): Double

Divide this quantity by a like quantity

Divide this quantity by a like quantity

Value Params
that

Quantity

Returns

Double

Inherited from
Quantity
def divide(that: Double): Mass

Divide this quantity by some number

Divide this quantity by some number

Value Params
that

Double

Returns

Quantity

Inherited from
Quantity
def divideAndRemainder(that: Mass): (Double, Mass)

Returns a Pair that includes the result of divideToInteger and remainder

Returns a Pair that includes the result of divideToInteger and remainder

Value Params
that

Quantity

Returns

(Double, Quantity)

Inherited from
Quantity
def divideAndRemainder(that: Double): (Mass, Mass)

Returns a Pair that includes the result of divideToInteger and remainder

Returns a Pair that includes the result of divideToInteger and remainder

Value Params
that

Double

Returns

(Quantity, Quantity)

Inherited from
Quantity
override def equals(that: Any): Boolean

Override of equals method

Override of equals method

Value Params
that

must be of matching value and unit

Definition Classes
Quantity -> Any
Inherited from
Quantity
def floor: Mass

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)

Inherited from
Quantity
override def hashCode(): Int

Override of hashCode

Override of hashCode

Definition Classes
Quantity -> Any
Inherited from
Quantity
def in(uom: UnitOfMeasure[Mass]): Mass

Returns an equivalent Quantity boxed with the supplied Unit

Returns an equivalent Quantity boxed with the supplied Unit

Value Params
uom

UnitOfMeasure[A]

Returns

Quantity

Inherited from
Quantity
def map(f: Double => Double): Mass

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

Value Params
f

Double => Double function

Inherited from
Quantity
def max(that: Mass): Mass

Returns the max of this and that Quantity

Returns the max of this and that Quantity

Value Params
that

Quantity

Returns

Quantity

Inherited from
Quantity
def min(that: Mass): Mass

Returns the min of this and that Quantity

Returns the min of this and that Quantity

Value Params
that

Quantity

Returns

Quantity

Inherited from
Quantity
def minus(that: Mass): Mass

Subtract two like quantities

Subtract two like quantities

Value Params
that

Quantity

Returns

Quantity

Inherited from
Quantity
def negate: Mass

Returns the negative value of this Quantity

Returns the negative value of this Quantity

Returns

Quantity

Inherited from
Quantity
def notWithin(range: QuantityRange[Mass]): Boolean

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

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

Value Params
range

QuantityRange

Returns

Boolean

Inherited from
Quantity
def per(that: Time): MassFlow
Inherited from
TimeIntegral
def plus(that: Mass): Mass

Add two like quantities

Add two like quantities

Value Params
that

Quantity

Returns

Quantity

Inherited from
Quantity

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

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

Value Params
that

Quantity

Returns

QuantityRange

Inherited from
Quantity
def remainder(that: Mass): Double

Returns the remainder of a division by a like quantity

Returns the remainder of a division by a like quantity

Value Params
that

Quantity

Returns

Double

Inherited from
Quantity
def remainder(that: Double): Mass

Returns the remainder of a division by a number

Returns the remainder of a division by a number

Value Params
that

Quantity

Returns

Quantity

Inherited from
Quantity
def rint: Mass

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)

Inherited from
Quantity
def rounded(scale: Int, mode: RoundingMode): Mass

Returns the Quantity with its coefficient value rounded using scale and mode. The unit is maintained.

Returns the Quantity with its coefficient value rounded using scale and mode. The unit is maintained.

Value Params
mode

RoundingMode - defaults to HALF_EVEN

scale

Int - scale of the value to be returned

Returns

Quantity

Inherited from
Quantity
def times(that: Double): Mass

Multiply this quantity by some number

Multiply this quantity by some number

Value Params
that

Double

Returns

Quantity

Inherited from
Quantity
def to(uom: UnitOfMeasure[Mass]): 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)
Value Params
uom

UnitOfMeasure[A]

Returns

Double

Inherited from
Quantity
def to(that: Mass): QuantityRange[Mass]

Returns a QuantityRange that goes from this to that

Returns a QuantityRange that goes from this to that

Value Params
that

Quantity

Returns

QuantityRange

Inherited from
Quantity
override 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 -> Any
Inherited from
Quantity
def toString(uom: UnitOfMeasure[Mass], 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

Value Params
format

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

uom

UnitOfMeasure[A] with UnitConverter

Returns

String

Inherited from
Quantity
def toString(uom: UnitOfMeasure[Mass]): 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

Value Params
uom

UnitOfMeasure[A] with UnitConverter

Returns

String

Inherited from
Quantity
def toTuple(uom: UnitOfMeasure[Mass]): (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

Value Params
uom

UnitOfMeasure[A]

Inherited from
Quantity
def toTuple: (Double, String)

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

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

Inherited from
Quantity
Inherited from
Quantity
def within(range: QuantityRange[Mass]): Boolean

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

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

Value Params
range

QuantityRange

Returns

Boolean

Inherited from
Quantity
def ~=(that: Mass)(tolerance: Mass): Boolean

approx

approx

Inherited from
Quantity
def (that: Mass)(tolerance: Mass): Boolean

approx

approx

Inherited from
Quantity

Concrete fields

val value: Double