Package org.ojalgo.scalar
Class Quantity
- java.lang.Object
-
- org.ojalgo.scalar.ExactDecimal<Quantity>
-
- org.ojalgo.scalar.Quantity
-
- All Implemented Interfaces:
java.lang.Comparable<Quantity>
,Field<Scalar<Quantity>>
,Group
,Group.Additive<Scalar<Quantity>>
,Group.Multiplicative<Scalar<Quantity>>
,NormedVectorSpace<Scalar<Quantity>,Quantity>
,Operation
,Operation.Addition<Scalar<Quantity>>
,Operation.Division<Scalar<Quantity>>
,Operation.Multiplication<Scalar<Quantity>>
,Operation.Subtraction<Scalar<Quantity>>
,Ring<Scalar<Quantity>>
,ScalarOperation
,ScalarOperation.Addition<Scalar<Quantity>,Quantity>
,ScalarOperation.Division<Scalar<Quantity>,Quantity>
,ScalarOperation.Multiplication<Scalar<Quantity>,Quantity>
,ScalarOperation.Subtraction<Scalar<Quantity>,Quantity>
,VectorSpace<Scalar<Quantity>,Quantity>
,Scalar<Quantity>
,SelfDeclaringScalar<Quantity>
,AccessScalar<Quantity>
,Tensor<Quantity,Scalar<Quantity>>
,NumberContext.Enforceable<Quantity>
,NumberDefinition
public final class Quantity extends ExactDecimal<Quantity>
quantity as in "amount = price * quatity"
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.scalar.ExactDecimal
ExactDecimal.Descriptor, ExactDecimal.Factory<S extends ExactDecimal<S>>
-
Nested classes/interfaces inherited from interface org.ojalgo.algebra.Group
Group.Additive<T>, Group.Multiplicative<T>
-
Nested classes/interfaces inherited from interface org.ojalgo.algebra.Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>
-
Nested classes/interfaces inherited from interface org.ojalgo.algebra.ScalarOperation
ScalarOperation.Addition<T,N extends java.lang.Comparable<N>>, ScalarOperation.Division<T,N extends java.lang.Comparable<N>>, ScalarOperation.Multiplication<T,N extends java.lang.Comparable<N>>, ScalarOperation.Subtraction<T,N extends java.lang.Comparable<N>>
-
-
Field Summary
Fields Modifier and Type Field Description static ExactDecimal.Descriptor
DESCRIPTOR
private static double
DOUBLE_DENOMINATOR
static Scalar.Factory<Quantity>
FACTORY
private static long
LONG_DENOMINATOR
static Quantity
NEG
static Quantity
ONE
static Quantity
TWO
static Quantity
ZERO
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExactDecimal.Descriptor
descriptor()
Amount
multiply(Price price)
static Quantity
valueOf(double value)
static Quantity
valueOf(java.lang.Comparable<?> number)
protected Quantity
wrap(long numerator)
-
Methods inherited from class org.ojalgo.scalar.ExactDecimal
add, add, compareTo, conjugate, divide, divide, doubleValue, enforce, extractUnscaledValue, floatValue, get, intValue, invert, isAbsolute, isSmall, longValue, multiply, multiply, negate, norm, numerator, power, signum, subtract, subtract, toBigDecimal, toString, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ojalgo.type.NumberDefinition
booleanValue, byteValue, shortValue
-
Methods inherited from interface org.ojalgo.scalar.Scalar
add, dimensions, divide, multiply, rank, subtract, toPlainString
-
Methods inherited from interface org.ojalgo.scalar.SelfDeclaringScalar
add, divide, multiply, subtract
-
Methods inherited from interface org.ojalgo.tensor.Tensor
components, isSameShape
-
-
-
-
Field Detail
-
DESCRIPTOR
public static final ExactDecimal.Descriptor DESCRIPTOR
-
FACTORY
public static final Scalar.Factory<Quantity> FACTORY
-
DOUBLE_DENOMINATOR
private static final double DOUBLE_DENOMINATOR
- See Also:
- Constant Field Values
-
LONG_DENOMINATOR
private static final long LONG_DENOMINATOR
- See Also:
- Constant Field Values
-
NEG
public static final Quantity NEG
-
ONE
public static final Quantity ONE
-
TWO
public static final Quantity TWO
-
ZERO
public static final Quantity ZERO
-
-
Method Detail
-
valueOf
public static Quantity valueOf(java.lang.Comparable<?> number)
-
valueOf
public static Quantity valueOf(double value)
-
descriptor
protected ExactDecimal.Descriptor descriptor()
- Specified by:
descriptor
in classExactDecimal<Quantity>
-
wrap
protected Quantity wrap(long numerator)
- Specified by:
wrap
in classExactDecimal<Quantity>
-
-