gnu.math
Class DQuantity
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
gnu.math.DQuantity
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public class DQuantity
- extends Quantity
- implements java.io.Externalizable
A Quantity represented as the product of a plain double and a Unit.
- See Also:
- Serialized Form
Methods inherited from class gnu.math.Quantity |
abs, add, compare, compare, compareReversed, dimensions, divide, doubleImagValue, im, imValue, make, make, make, neg, reValue, times, toString |
Methods inherited from class gnu.math.Numeric |
add, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, power, sub, toString |
Methods inherited from class java.lang.Number |
byteValue, shortValue |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DQuantity
public DQuantity(double factor,
Unit unit)
unit
public final Unit unit()
- Overrides:
unit
in class Quantity
number
public final Complex number()
- Specified by:
number
in class Quantity
re
public final RealNum re()
- Description copied from class:
Quantity
- 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.
- Overrides:
re
in class Quantity
doubleValue
public final double doubleValue()
- Description copied from class:
Quantity
- The value of the real component, as a double.
This is relative to the unit().dims - i.e. unit()/doubleValue()
is factored in.
- Overrides:
doubleValue
in class Quantity
isExact
public boolean isExact()
- Specified by:
isExact
in class Numeric
isZero
public boolean isZero()
- Specified by:
isZero
in class Numeric
add
public static DQuantity add(DQuantity x,
DQuantity y,
double k)
times
public static DQuantity times(DQuantity x,
DQuantity y)
divide
public static DQuantity divide(DQuantity x,
DQuantity y)
add
public Numeric add(java.lang.Object y,
int k)
- Description copied from class:
Numeric
- Return this + k * obj.
- Overrides:
add
in class Quantity
addReversed
public Numeric addReversed(Numeric x,
int k)
- Description copied from class:
Numeric
- Calculate x+k&this.
- Overrides:
addReversed
in class Quantity
mul
public Numeric mul(java.lang.Object y)
- Overrides:
mul
in class Quantity
mulReversed
public Numeric mulReversed(Numeric x)
- Overrides:
mulReversed
in class Quantity
div
public Numeric div(java.lang.Object y)
- Overrides:
div
in class Quantity
divReversed
public Numeric divReversed(Numeric x)
- Overrides:
divReversed
in class Quantity
writeExternal
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
- Specified by:
writeExternal
in interface java.io.Externalizable
- Throws:
java.io.IOException
readExternal
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Specified by:
readExternal
in interface java.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException