com.ail.util
Class Percent

java.lang.Object
  extended by com.ail.core.Type
      extended by com.ail.util.Percent
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

Deprecated. Use com.ail.util.Rate instead.

public class Percent
extends Type

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.

Version:
$Revision: 1.1 $
See Also:
Serialized Form

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

Percent

public Percent()
Deprecated. 
Default constructor


Percent

public Percent(double rate)
        throws java.lang.IllegalArgumentException
Deprecated. 
Initialising constructor

Parameters:
rate - The rate to be represented
Throws:
java.lang.IllegalArgumentException - If rate is not >=0 && <=1
Method Detail

getRate

public double getRate()
Deprecated. 
Get the current rate.

Returns:
Rate as a double

setRate

public void setRate(double rate)
             throws java.lang.IllegalArgumentException
Deprecated. 
Set the rate.

Parameters:
rate - New rate.
Throws:
java.lang.IllegalArgumentException - If rate argument is not >=0 && <=1

applyTo

public double applyTo(double value)
Deprecated. 
Apply this percentage to a value

Parameters:
value - The value to apply to
Returns:
The result