UnitOfMeasure

trait UnitOfMeasure[A <: Quantity[A]] extends Serializable

A Unit of Measure is used to define the scale of a quantity measurement

A Unit of Measure is used to define the scale of a quantity measurement

Each Quantity Dimension must include at least one Unit of Measure, and one and only one Primary. Other units of measure are defined with conversionFactors relative to the Primary.

Type Params
A

The type of Quantity being measured

Authors

garyKeorkunian

Since

0.1

trait Serializable
class Object
trait Matchable
class Any
object Dozen
object Each
object Gross
object Percent
object Score
object Farads
object Kilofarads
object Nanofarads
object Picofarads
object Abcoulombs
object Coulombs
object Amperes
object Kilovolts
object Megavolts
object Microvolts
object Millivolts
object Volts
object Siemens
object Gigohms
object Kilohms
object Megohms
object Microohms
object Milliohms
object Nanohms
object Ohms
object Henry
object Microhenry
object Millihenry
object Nanohenry
object Picohenry
object Gauss
object Teslas
object Webers
object OhmMeters
object Ergs
object Gigajoules
object Joules
object Kilojoules
object MBtus
object MMBtus
object Megajoules
object Nanojoules
object Picojoules
object Terajoules
object WattHours
trait PowerUnit
object Gigawatts
object Kilowatts
object Megawatts
object Milliwatts
object Watts
object Grays
object Rads
object Bits
object Bytes
object Exabits
object Exabytes
object Exbibits
object Exbibytes
object Gibibits
object Gibibytes
object Gigabits
object Gigabytes
object Kibibits
object Kibibytes
object Kilobits
object Kilobytes
object Mebibits
object Mebibytes
object Megabits
object Megabytes
object Octets
object Pebibits
object Pebibytes
object Petabits
object Petabytes
object Tebibits
object Tebibytes
object Terabits
object Terabytes
object Yobibits
object Yobibytes
object Yottabits
object Yottabytes
object Zebibits
object Zebibytes
object Zettabits
object Zettabytes
class Currency
object ARS
object AUD
object BRL
object BTC
object CAD
object CHF
object CLP
object CNY
object CZK
object DKK
object ETH
object EUR
object GBP
object HKD
object INR
object JPY
object KRW
object LTC
object MXN
object MYR
object NAD
object NOK
object NZD
object RUB
object SEK
object TRY
object USD
object XAG
object XAU
object ZAR
object Moles
object PoundMoles
trait MassUnit
object Carats
object Grams
object Kilograms
object Kilopounds
object Megapounds
object Micrograms
object Milligrams
object Nanograms
object Ounces
object Pounds
object Stone
object Tolas
object Tonnes
object TroyGrains
object TroyOunces
object TroyPounds
trait ForceUnit
object Newtons
object PoundForce
trait JerkUnit
object Bars
object Pascals
object Torrs
object PoundFeet
object Knots
trait YankUnit
object Lux
object LuxSeconds
object Lumens
object Candelas
object Becquerels
object Curies
trait DoseUnit
object Rems
object Sieverts
trait AngleUnit
object Arcminutes
object Arcseconds
object Degrees
object Gradians
object Radians
object Turns
trait AreaUnit
object Acres
object Barnes
object Hectares
object SquareFeet
object Angstroms
object Decameters
object Decimeters
object Feet
object Inches
object Kilometers
object LightYears
object Meters
object Microns
object Nanometers
object Parsecs
object SolarRadii
object UsMiles
object Yards
object AcreFeet
object CubicFeet
object CubicYards
object Decilitres
object Litres
object Nanolitres
object Teaspoons
object UsCups
object UsDryCups
object UsDryPints
object UsGallons
object UsPints
object UsQuarts
object Celsius
object Fahrenheit
object Kelvin
object Rankine
object Gigahertz
object Hertz
object Kilohertz
object Megahertz
object Terahertz
trait TimeUnit
object Days
object Hours
object Minutes
object Seconds

Value members

Abstract methods

def apply[N](n: N)(num: Numeric[N]): A

Factory method for creating instances of a Quantity in this UnitOfMeasure

Factory method for creating instances of a Quantity in this UnitOfMeasure

Value Params
n

N - the Quantity's value in terms of this UnitOfMeasure

protected def converterFrom: Double => Double

Defines a signature for converting a quantity from this UOM to the Value UOM

Defines a signature for converting a quantity from this UOM to the Value UOM

protected def converterTo: Double => Double

Defines a signature for converting a quantity to this UOM from the Value UOM

Defines a signature for converting a quantity to this UOM from the Value UOM

def symbol: String

Symbol used when representing Quantities in this UnitOfMeasure

Symbol used when representing Quantities in this UnitOfMeasure

Concrete methods

final def convertFrom[N](n: N)(num: Numeric[N]): Double

Applies the converterFrom method to a value

Applies the converterFrom method to a value

Type Params
N

Type

Value Params
n

N value in terms of this Unit

num

Numeric[N]

final def convertTo[N](n: N)(num: Numeric[N]): Double

Applies the converterTo method to a value

Applies the converterTo method to a value

Type Params
N

Type

Value Params
n

N value in terms of the ValueUnit

num

Numeric[N]

def unapply(q: A): Some[Double]

Extractor method for getting the Numeric value of a Quantity in this UnitOfMeasure

Extractor method for getting the Numeric value of a Quantity in this UnitOfMeasure

Value Params
q

A - The Quantity being matched