com.prozima.pengine
Class CostRule

java.lang.Object
  extended by com.prozima.pengine.CostRule
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
HourlyCostRule

public abstract class CostRule
extends java.lang.Object
implements java.lang.Cloneable

Each Resource has one or more cost rules associated with it which define the cost of using the Resource. All cost rules must inherit from this abstract class.


Method Summary
 boolean setCurrency(java.util.Currency inCurrency)
          Set the currency used to express the rate and to calculate the cost.
 boolean setRate(java.math.BigDecimal inRate)
          Set the rate used to calculate the cost.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setCurrency

public boolean setCurrency(java.util.Currency inCurrency)
Set the currency used to express the rate and to calculate the cost.

Parameters:
inCurrency - Currency used to express the rate. Cannot be null.
Returns:
true if currency was set correctly, otherwise false.

setRate

public boolean setRate(java.math.BigDecimal inRate)
Set the rate used to calculate the cost. How the rate is applied depends on the sub-class.

Parameters:
inRate - Rate in a specific currency. Cannot be null.
Returns:
true if the rate was set correctly, otherwise false.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object