Package gnu.math
Class DQuantity
- java.lang.Object
-
- java.lang.Number
-
- gnu.math.Numeric
-
- gnu.math.Quantity
-
- gnu.math.DQuantity
-
- All Implemented Interfaces:
Externalizable,Serializable
public class DQuantity extends Quantity implements 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(Object y, int k)Return this + k * obj.NumericaddReversed(Numeric x, int k)Calculatex+k&this.Numericdiv(Object y)static DQuantitydivide(DQuantity x, DQuantity y)NumericdivReversed(Numeric x)doubledoubleValue()The value of the real component, as a double.booleanisExact()booleanisZero()Numericmul(Object y)NumericmulReversed(Numeric x)Complexnumber()RealNumre()The value of the real component, as a RealNum.voidreadExternal(ObjectInput in)static DQuantitytimes(DQuantity x, DQuantity y)Unitunit()voidwriteExternal(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
-
Methods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, power, sub, toExact, toInexact, toString
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
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(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(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-