squants

package squants

Type members

Classlikes

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

SI Base Quantity

SI Base Quantity

object BinarySystem

Singleton defining Metric System multipliers

Singleton defining Metric System multipliers

Authors

garyKeorkunian

Since

0.1

trait Dimension[A <: Quantity[A]]

Represents a Dimension or Quantity Type

Represents a Dimension or Quantity Type

This trait should be mixed into the Companion Objects of specific Quantity Types.

Type Params
A

Quantity Type

Represents a quantity of some thing for which there is no dimension.

Represents a quantity of some thing for which there is no dimension.

This may be used to represent counts or other discrete amounts of everyday life, but may also represent ratios between like quantities where the units have cancelled out.

Value Params
value

Double the amount

Authors

garyKeorkunian

Since

0.1

Companion
object

Factory singleton for squants.Dimensionless

Factory singleton for squants.Dimensionless

Companion
class

Base trait for units of squants.Dimensionless

Base trait for units of squants.Dimensionless

The DimensionlessUnit is a useful paradox

case class DoubleVector(coordinates: Double*) extends SVector[Double]

Double (Real Number) Vector

Double (Real Number) Vector

Value Params
coordinates

Double*

Authors

garyKeorkunian

Since

0.3.0

object Dozen extends DimensionlessUnit

Represents a unit of dozen (12)

Represents a unit of dozen (12)

object Each extends DimensionlessUnit with PrimaryUnit with SiUnit

Represents a unit of singles

Represents a unit of singles

object Gross extends DimensionlessUnit

Represents a unit of gross (144)

Represents a unit of gross (144)

trait LikeRatio[A <: Quantity[A]] extends Ratio[A, A]
object MetricSystem

Singleton defining Metric System multipliers

Singleton defining Metric System multipliers

Authors

garyKeorkunian

Since

0.1

object Percent extends DimensionlessUnit

Represents a number of hundredths (0.01)

Represents a number of hundredths (0.01)

object Platform
trait PrimaryUnit extends UnitConverter

Identifies the Unit of Measure with a conversionFactor of 1.0.

Identifies the Unit of Measure with a conversionFactor of 1.0.

It is used as the intermediary unit during conversions

Each Quantity should have one and only one ValueUnit

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

A base class for measurable quantities, instances of which contain a value and a unit

A base class for measurable quantities, instances of which contain a value and a unit

Authors

garyKeorkunian

Since

0.1

case class QuantityParseException(message: String, expression: String) extends Exception
case class QuantityRange[A <: Quantity[A]](lower: A, upper: A)

Represents a Range starting at one Quantity value and going up to another

Represents a Range starting at one Quantity value and going up to another

Type Params
A

the Quantity Type

Value Params
lower

Quantity representing the lower bound of the range

upper

Quantity representing the upper bound of the range

Authors

garyKeorkunian

Since

0.1

case class QuantityVector[A <: Quantity[A]](coordinates: A*) extends SVector[A]

Quantity Vector

Quantity Vector

Type Params
A

QuantityType

Value Params
coordinates

Variable list of A

Authors

garyKeorkunian

Since

0.3.0

trait Ratio[A <: Quantity[A], B <: Quantity[B]]

Defines an interface and partial implementation for types that represent a ratio between any two quantities

Defines an interface and partial implementation for types that represent a ratio between any two quantities

Type Params
A

Quantity A

B

Quantity B

Authors

garyKeorkunian

Since

0.1

trait SVector[A]

Root trait for representing Vectors

Root trait for representing Vectors

Type Params
A

Type for the Vector's coordinate values

Authors

garyKeorkunian

Since

0.3.0

Companion
object
object SVector
Companion
class
object Score extends DimensionlessUnit

Represents a unit of scores (20)

Represents a unit of scores (20)

trait SiBaseUnit extends SiUnit

A marker trait identifying SI Base Units

A marker trait identifying SI Base Units

trait SiUnit

A marker trait identifying SI Units

A marker trait identifying SI Units

class SquantifiedBigDecimal(bd: BigDecimal)

Provides implicit conversions that allow BigDecimals to lead in * and / by Time operations

Provides implicit conversions that allow BigDecimals to lead in * and / by Time operations

  BigDecimal(1.5) * Kilometers(10) should be(Kilometers(15))
Value Params
bd

BigDecimal

class SquantifiedDouble(d: Double)

Provides implicit conversions that allow Doubles to lead in * and / by Time operations

Provides implicit conversions that allow Doubles to lead in * and / by Time operations

  1.5 * Kilometers(10) should be(Kilometers(15))
Value Params
d

Double

class SquantifiedInt(l: Int)

Provides implicit conversions that allow Int to lead in * and / by Time operations

Provides implicit conversions that allow Int to lead in * and / by Time operations

  5 * Kilometers(10) should be(Kilometers(15))
Value Params
l

Int

class SquantifiedLong(l: Long)

Provides implicit conversions that allow Longs to lead in * and / by Time operations

Provides implicit conversions that allow Longs to lead in * and / by Time operations

  5 * Kilometers(10) should be(Kilometers(15))
Value Params
l

Long

A Unit of Measure that require a simple multiplier for converting to and from the underlying value's unit

A Unit of Measure that require a simple multiplier for converting to and from the underlying value's unit

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