net.commerce.zocalo.currency
Class RangedQuantity
java.lang.Object
net.commerce.zocalo.currency.Quantity
net.commerce.zocalo.currency.RangedQuantity
- All Implemented Interfaces:
- java.lang.Comparable
- Direct Known Subclasses:
- Price, Probability
public abstract class RangedQuantity
- extends Quantity
RangedQuantities are BigDecimals whose values range from zero to some maximum value.
They're useful for limited prices and for probabilities.
Methods inherited from class net.commerce.zocalo.currency.Quantity |
abs, absLog, approaches, asValue, compareTo, compareTo, div, div, exp, floor, getId, getQuant, isNegative, isNegligible, isNonNegative, isPositive, isZero, max, min, minus, movePointLeft, negate, newScale, plus, printAsDetailedQuantity, printAsDollars, printAsIntegerQuantity, printAsQuantity, printAsScore, remainder, round, roundFloor, scale, setId, setQuant, simplify, times, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
maxValue
protected Quantity maxValue
RangedQuantity
public RangedQuantity(java.math.BigDecimal q,
java.lang.String maximum)
RangedQuantity
public RangedQuantity(java.lang.String q,
java.lang.String maximum)
RangedQuantity
public RangedQuantity(Quantity q,
java.math.BigDecimal maximum)
RangedQuantity
public RangedQuantity(java.math.BigDecimal quantity,
Quantity max)
RangedQuantity
public RangedQuantity(double quantity,
Quantity max)
RangedQuantity
public RangedQuantity(java.lang.String q,
java.math.BigDecimal maximum)
RangedQuantity
public RangedQuantity(java.lang.String q,
Quantity maximum)
RangedQuantity
public RangedQuantity(java.math.BigDecimal d,
java.math.BigDecimal maximum)
RangedQuantity
public RangedQuantity(Quantity quantity,
Quantity newRange)
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class Quantity
hashCode
public int hashCode()
- Overrides:
hashCode
in class Quantity
getMaxValue
public Quantity getMaxValue()
setMaxValue
public void setMaxValue(Quantity maxValue)
- Deprecated.
asQuantity
public Quantity asQuantity()
- Overrides:
asQuantity
in class Quantity
eq
public boolean eq(Quantity q)
- Overrides:
eq
in class Quantity
round
public abstract RangedQuantity round(java.math.MathContext c)
- Overrides:
round
in class Quantity
newValue
public abstract RangedQuantity newValue(Quantity quantity)
newValue
public abstract RangedQuantity newValue(java.math.BigDecimal quantity)
inverted
public abstract RangedQuantity inverted()
asProbability
public Probability asProbability()