gnu.math

Class Quantity

public abstract class Quantity extends Numeric

A quantity with a unit. This generalizes the DSSSL quantity type (to more than lengths).
Method Summary
Numericabs()
static Quantityadd(Quantity x, Quantity y, int k)
Numericadd(Object y, int k)
NumericaddReversed(Numeric x, int k)
static intcompare(Quantity x, Quantity y)
intcompare(Object obj)
intcompareReversed(Numeric x)
Dimensionsdimensions()
Numericdiv(Object y)
static Quantitydivide(Quantity x, Quantity y)
NumericdivReversed(Numeric x)
doubledoubleImagValue()
The value of the imaginary component, as a double.
doubledoubleValue()
The value of the real component, as a double.
RealNumim()
The value of the imaginary component, as a RealNum.
doubleimValue()
The value of the imaginary component, as a double.
static Quantitymake(Complex x, Unit u)
static Quantitymake(RealNum re, RealNum im, Unit unit)
static Quantitymake(double re, double im, Unit unit)
Numericmul(Object y)
NumericmulReversed(Numeric x)
Numericneg()
abstract Complexnumber()
RealNumre()
The value of the real component, as a RealNum.
doublereValue()
The value of the real component, as a double.
static Quantitytimes(Quantity x, Quantity y)
StringtoString(int radix)
Unitunit()

Method Detail

abs

public Numeric abs()

add

public static Quantity add(Quantity x, Quantity y, int k)

add

public Numeric add(Object y, int k)

addReversed

public Numeric addReversed(Numeric x, int k)

compare

public static int compare(Quantity x, Quantity y)

compare

public int compare(Object obj)

compareReversed

public int compareReversed(Numeric x)

dimensions

public Dimensions dimensions()

div

public Numeric div(Object y)

divide

public static Quantity divide(Quantity x, Quantity y)

divReversed

public Numeric divReversed(Numeric x)

doubleImagValue

public double doubleImagValue()
The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.

doubleValue

public double doubleValue()
The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.

im

public RealNum im()
The value of the imaginary component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true imaginary component.

imValue

public final double imValue()
The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit().doubleValue() is factored in. A final alias for the virtual doubleImagValue.

make

public static Quantity make(Complex x, Unit u)

make

public static Quantity make(RealNum re, RealNum im, Unit unit)

make

public static Quantity make(double re, double im, Unit unit)

mul

public Numeric mul(Object y)

mulReversed

public Numeric mulReversed(Numeric x)

neg

public Numeric neg()

number

public abstract Complex number()

re

public RealNum re()
The value of the real component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true real component.

reValue

public final double reValue()
The value of the real component, as a double. This is relative to the unit().dims - i.e. unit().doubleValue() is factored in. A final alias for the virtual doubleValue.

times

public static Quantity times(Quantity x, Quantity y)

toString

public String toString(int radix)

unit

public Unit unit()