- java.lang.Object
-
- org.ojalgo.scalar.ExactDecimal<Price>
-
- org.ojalgo.scalar.Price
-
- All Implemented Interfaces:
java.lang.Comparable<Price>,Field<Scalar<Price>>,Group,Group.Additive<Scalar<Price>>,Group.Multiplicative<Scalar<Price>>,NormedVectorSpace<Scalar<Price>,Price>,Operation,Operation.Addition<Scalar<Price>>,Operation.Division<Scalar<Price>>,Operation.Multiplication<Scalar<Price>>,Operation.Subtraction<Scalar<Price>>,Ring<Scalar<Price>>,ScalarOperation,ScalarOperation.Addition<Scalar<Price>,Price>,ScalarOperation.Division<Scalar<Price>,Price>,ScalarOperation.Multiplication<Scalar<Price>,Price>,ScalarOperation.Subtraction<Scalar<Price>,Price>,VectorSpace<Scalar<Price>,Price>,Scalar<Price>,SelfDeclaringScalar<Price>,AccessScalar<Price>,Tensor<Price,Scalar<Price>>,NumberContext.Enforceable<Price>,NumberDefinition
public final class Price extends ExactDecimal<Price>
price or exchange rate as in "amount = price * quatity" or "amount = rate * amount"
-
-
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.DescriptorDESCRIPTORprivate static doubleDOUBLE_DENOMINATORstatic Scalar.Factory<Price>FACTORYprivate static longLONG_DENOMINATORstatic PriceNEGstatic PriceONEstatic PriceTWOstatic PriceZERO
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExactDecimal.Descriptordescriptor()Amountmultiply(Quantity quanntity)static PricevalueOf(double value)static PricevalueOf(java.lang.Comparable<?> number)protected Pricewrap(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, isZero, 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<Price> 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 Price NEG
-
ONE
public static final Price ONE
-
TWO
public static final Price TWO
-
ZERO
public static final Price ZERO
-
-
Method Detail
-
valueOf
public static Price valueOf(java.lang.Comparable<?> number)
-
valueOf
public static Price valueOf(double value)
-
descriptor
protected ExactDecimal.Descriptor descriptor()
- Specified by:
descriptorin classExactDecimal<Price>
-
wrap
protected Price wrap(long numerator)
- Specified by:
wrapin classExactDecimal<Price>
-
-