|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ail.core.Type
com.ail.util.Percent
public class Percent
This class represents a percentage value based on a double. todo A rate should be between 0 and 100 not 0 and 1 todo The rate should be represented as a BigDecimal - not a double.
| Field Summary |
|---|
| Fields inherited from class com.ail.core.Type |
|---|
jXPathContext, NOT_PERSISTED |
| Constructor Summary | |
|---|---|
Percent()
Deprecated. Default constructor |
|
Percent(double rate)
Deprecated. Initialising constructor |
|
| Method Summary | |
|---|---|
double |
applyTo(double value)
Deprecated. Apply this percentage to a value |
double |
getRate()
Deprecated. Get the current rate. |
void |
setRate(double rate)
Deprecated. Set the rate. |
| Methods inherited from class com.ail.core.Type |
|---|
addAttribute, clone, deleteLock, deleteSerialVersion, fetchJXPathContext, getAttribute, getAttribute, getAttributeCount, getForeignSystemId, getLock, getSerialVersion, getSystemId, hasLock, hasSerialVersion, hasSystemId, isPersisted, markAsNotPersisted, mergeWithDataFrom, removeAttribute, removeAttribute, setAttribute, setForeignSystemId, setLock, setSerialVersion, setSystemId, xpathGet, xpathGet, xpathIterate, xpathSet |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Percent()
public Percent(double rate)
throws java.lang.IllegalArgumentException
rate - The rate to be represented
java.lang.IllegalArgumentException - If rate is not >=0 && <=1| Method Detail |
|---|
public double getRate()
public void setRate(double rate)
throws java.lang.IllegalArgumentException
rate - New rate.
java.lang.IllegalArgumentException - If rate argument is not >=0 && <=1public double applyTo(double value)
value - The value to apply to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||