com.ail.insurance.policy
Class Totalizer

java.lang.Object
  extended by com.ail.core.Type
      extended by com.ail.insurance.policy.AssessmentLine
          extended by com.ail.insurance.policy.CalculationLine
              extended by com.ail.insurance.policy.Totalizer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AssessmentLine>

public class Totalizer
extends CalculationLine

The totalizer calculation line adds any number of other named lines up to make a total, and optionally contributes that total to another line.

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

Field Summary
 
Fields inherited from class com.ail.core.Type
jXPathContext, NOT_PERSISTED
 
Constructor Summary
Totalizer()
           
Totalizer(java.lang.String id, java.lang.String reason, Reference relatesTo, java.lang.String contributesTo, java.lang.String dependsOn)
           
Totalizer(java.lang.String id, java.lang.String reason, Reference relatesTo, java.lang.String contributesTo, java.lang.String dependsOn, int priority)
           
 
Method Summary
 boolean calculate(AssessmentSheetList sheets, AssessmentSheet sheet)
          Process this line's calculation
 java.lang.String getDependsOn()
          Get the Ids of the lines that this totalizer depends on.
 void setDependsOn(java.lang.String dependsOn)
          Set the Ids of the lines that this totalizer depends on.
 
Methods inherited from class com.ail.insurance.policy.CalculationLine
getAmount, getAmountAsString, getContributesTo, setAmount, setContributesTo
 
Methods inherited from class com.ail.insurance.policy.AssessmentLine
compareTo, getCalculatedOrder, getId, getOrigin, getPriority, getReason, getRelatesTo, isDisabled, setCalculatedOrder, setDisabled, setId, setOrigin, setPriority, setReason, setRelatesTo
 
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

Totalizer

public Totalizer()

Totalizer

public Totalizer(java.lang.String id,
                 java.lang.String reason,
                 Reference relatesTo,
                 java.lang.String contributesTo,
                 java.lang.String dependsOn)
Parameters:
id - This line's Id
reason - Free text reson for this behaviour being created.
relatesTo - Optional reference to the part of the policy that caused this behaviour.
contributesTo - The Id of the line that this one will contribute to.
dependsOn - A comma seperated list of the IDs of the lines that this one depends on (will sum).

Totalizer

public Totalizer(java.lang.String id,
                 java.lang.String reason,
                 Reference relatesTo,
                 java.lang.String contributesTo,
                 java.lang.String dependsOn,
                 int priority)
Parameters:
id - This line's Id
reason - Free text reson for this behaviour being created.
relatesTo - Optional reference to the part of the policy that caused this behaviour.
contributesTo - The Id of the line that this one will contribute to.
dependsOn - A comma seperated list of the IDs of the lines that this one depends on (will sum).
priority - The priority of this line wrt other lines in the same sheet (lines with higher priority values are processed first)
Method Detail

getDependsOn

public java.lang.String getDependsOn()
Get the Ids of the lines that this totalizer depends on. The Ids are returned as a comma seperated list.

Returns:
List of the IDs of the lines that this line depends on.

setDependsOn

public void setDependsOn(java.lang.String dependsOn)
Set the Ids of the lines that this totalizer depends on. The Ids are passed as a comma seperated list.

Parameters:
dependsOn - List of the IDs of the lines that this line depends on.

calculate

public boolean calculate(AssessmentSheetList sheets,
                         AssessmentSheet sheet)
Description copied from class: CalculationLine
Process this line's calculation

Specified by:
calculate in class CalculationLine
Parameters:
sheets - The list of assessment sheets currently being processed.
sheet - The sheet this line is part of.
Returns:
true if the line gets processed, false otherwise.