Package 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DQuantityadd(DQuantity x, DQuantity y, double k)Numericadd(java.lang.Object y, int k)Return this + k * obj.NumericaddReversed(Numeric x, int k)Calculatex+k&this.Numericdiv(java.lang.Object y)static DQuantitydivide(DQuantity x, DQuantity y)NumericdivReversed(Numeric x)doubledoubleValue()The value of the real component, as a double.booleanisExact()booleanisZero()Numericmul(java.lang.Object y)NumericmulReversed(Numeric x)Complexnumber()RealNumre()The value of the real component, as a RealNum.voidreadExternal(java.io.ObjectInput in)static DQuantitytimes(DQuantity x, DQuantity y)Unitunit()voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class gnu.math.Quantity
abs, add, compare, compare, compareReversed, dimensions, divide, doubleImagValue, doubleJmagValue, doubleKmagValue, im, imValue, jm, jmValue, km, kmValue, make, make, make, neg, reValue, times, toString
-
-
-
-
Constructor Detail
-
DQuantity
public DQuantity(double factor, Unit unit)
-
-
Method Detail
-
re
public final RealNum re()
Description copied from class:QuantityThe 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.
-
doubleValue
public final double doubleValue()
Description copied from class:QuantityThe value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValuein classQuantity
-
add
public Numeric add(java.lang.Object y, int k)
Description copied from class:NumericReturn this + k * obj.
-
addReversed
public Numeric addReversed(Numeric x, int k)
Description copied from class:NumericCalculatex+k&this.- Overrides:
addReversedin classQuantity
-
mulReversed
public Numeric mulReversed(Numeric x)
- Overrides:
mulReversedin classQuantity
-
divReversed
public Numeric divReversed(Numeric x)
- Overrides:
divReversedin classQuantity
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-