Package org.ojalgo.scalar
Class Amount
- java.lang.Object
-
- org.ojalgo.scalar.ExactDecimal<Amount>
-
- org.ojalgo.scalar.Amount
-
- All Implemented Interfaces:
java.lang.Comparable<Amount>
,Field<Scalar<Amount>>
,Group
,Group.Additive<Scalar<Amount>>
,Group.Multiplicative<Scalar<Amount>>
,NormedVectorSpace<Scalar<Amount>,Amount>
,Operation
,Operation.Addition<Scalar<Amount>>
,Operation.Division<Scalar<Amount>>
,Operation.Multiplication<Scalar<Amount>>
,Operation.Subtraction<Scalar<Amount>>
,Ring<Scalar<Amount>>
,ScalarOperation
,ScalarOperation.Addition<Scalar<Amount>,Amount>
,ScalarOperation.Division<Scalar<Amount>,Amount>
,ScalarOperation.Multiplication<Scalar<Amount>,Amount>
,ScalarOperation.Subtraction<Scalar<Amount>,Amount>
,VectorSpace<Scalar<Amount>,Amount>
,Scalar<Amount>
,SelfDeclaringScalar<Amount>
,AccessScalar<Amount>
,Tensor<Amount,Scalar<Amount>>
,NumberContext.Enforceable<Amount>
,NumberDefinition
public final class Amount extends ExactDecimal<Amount>
(currency) amount 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<Amount>
FACTORY
private static long
LONG_DENOMINATOR
static Amount
NEG
static Amount
ONE
static Amount
TWO
static Amount
ZERO
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExactDecimal.Descriptor
descriptor()
Quantity
divide(Price price)
Price
divide(Quantity quanntity)
Amount
multiply(Price rate)
static Amount
valueOf(double value)
static Amount
valueOf(java.lang.Comparable<?> number)
protected Amount
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<Amount> 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 Amount NEG
-
ONE
public static final Amount ONE
-
TWO
public static final Amount TWO
-
ZERO
public static final Amount ZERO
-
-
Method Detail
-
valueOf
public static Amount valueOf(java.lang.Comparable<?> number)
-
valueOf
public static Amount valueOf(double value)
-
descriptor
protected ExactDecimal.Descriptor descriptor()
- Specified by:
descriptor
in classExactDecimal<Amount>
-
wrap
protected Amount wrap(long numerator)
- Specified by:
wrap
in classExactDecimal<Amount>
-
-