|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prozima.pengine.CostTable
public class CostTable
A CostTable controls the allocation of CostRules, allowing their
organisation by time and priority. Eras are used to define the periods of time
during which specific cost rules apply. Within the same era, cost rules are
applied in the order of their priority.
| Field Summary | |
|---|---|
static int |
DEFAULT_ERA_ID
ID of the default era. |
static int |
DEFAULT_RULE_PRIORITY
Priority assigned to default cost rule - cannot be changed. |
static int |
MAX_PRIORITY
Maximum priority a cost rule may be assigned. |
static int |
MIN_PRIORITY
Minimum priority a cost rule may be assigned. |
| Constructor Summary | |
|---|---|
CostTable()
Create a CostTable and initialise it with default values. |
|
| Method Summary | |
|---|---|
boolean |
addCostRule(int inEraID,
boolean inAddAtTop,
CostRule inRule)
Add a cost rule to the cost table. |
java.lang.Integer |
createEra(DayAndYear inStart)
Create a new Era which is used to control cost rules. |
java.util.Set<java.lang.Integer> |
getAllEraIDs()
Get set of all defined era IDs. |
java.util.List<CostRule> |
getCostRules(int inEraID)
Get an ordered list of all the cost rules for a specific era. |
boolean |
priorityDecrease(int inEraID,
CostRule inRule)
Decrease the priority of a cost rule. |
boolean |
priorityIncrease(int inEraID,
CostRule inRule)
Increase the priority of a cost rule. |
boolean |
removeCostRule(int inEraID,
CostRule inRule)
Remove a cost rule from the cost table. |
boolean |
removeEra(int inEraID)
Remove a previously created era. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ERA_ID
public static final int DEFAULT_RULE_PRIORITY
public static final int MAX_PRIORITY
public static final int MIN_PRIORITY
| Constructor Detail |
|---|
public CostTable()
CostTable and initialise it with default values.
| Method Detail |
|---|
public boolean addCostRule(int inEraID,
boolean inAddAtTop,
CostRule inRule)
inEraID - ID of the era.inAddAtTop - true if cost rule should be added with a priority greater than
other cost rules. false if cost rule should be added with the lowest priority.inRule - Cost rule which is being added.
public java.lang.Integer createEra(DayAndYear inStart)
inStart - Start of the era.
public java.util.Set<java.lang.Integer> getAllEraIDs()
public java.util.List<CostRule> getCostRules(int inEraID)
inEraID - ID of an era.
public boolean priorityDecrease(int inEraID,
CostRule inRule)
inEraID - ID identifying the era which the cost rule belongs to.inRule - Cost rule which should have its priority decreased.
public boolean priorityIncrease(int inEraID,
CostRule inRule)
inEraID - ID identifying the era which the cost rule belongs to.inRule - Cost rule which should have its priority increased.
public boolean removeCostRule(int inEraID,
CostRule inRule)
inEraID - ID of the era. era must exist.inRule - Cost rule which is to be removed. Should not be null.
public boolean removeEra(int inEraID)
inEraID - ID of the era.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||