com.ail.insurance.policy
Class SumBehaviour
java.lang.Object
com.ail.core.Type
com.ail.insurance.policy.AssessmentLine
com.ail.insurance.policy.CalculationLine
com.ail.insurance.policy.Behaviour
com.ail.insurance.policy.SumBehaviour
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AssessmentLine>
public class SumBehaviour
- extends Behaviour
An assessment line which contributes a fixed sum to another line.
- Version:
- $Revision: 1.4 $
- See Also:
- Serialized Form
|
Constructor Summary |
SumBehaviour()
Default constructor |
SumBehaviour(java.lang.String id,
java.lang.String reason,
Reference relatesTo,
java.lang.String contributesTo,
BehaviourType type,
CurrencyAmount amount)
Constructor |
SumBehaviour(java.lang.String id,
java.lang.String reason,
Reference relatesTo,
java.lang.String contributesTo,
BehaviourType type,
CurrencyAmount amount,
int priority)
Constructor |
| 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 |
SumBehaviour
public SumBehaviour()
- Default constructor
SumBehaviour
public SumBehaviour(java.lang.String id,
java.lang.String reason,
Reference relatesTo,
java.lang.String contributesTo,
BehaviourType type,
CurrencyAmount amount)
- Constructor
- Parameters:
id - This line's Idreason - 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 line contributes to.type - The type of behaviour being represented.amount - The amount (value) represented by this line.
SumBehaviour
public SumBehaviour(java.lang.String id,
java.lang.String reason,
Reference relatesTo,
java.lang.String contributesTo,
BehaviourType type,
CurrencyAmount amount,
int priority)
- Constructor
- Parameters:
id - This line's Idreason - 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 line contributes to.type - The type of behaviour being represented.amount - The amount (value) represented by this line.priority - The priority of this line wrt other lines in the same sheet (lines with higher priority values are processed first)
calculate
public boolean calculate(AssessmentSheetList sheets,
AssessmentSheet sheet)
- Perform the calculation. For a FixedSum line this simply means take the amount property and
apply it to the assessment line indicated by the contributeTo property. If the behaviour
type is Load then amount will be added to the target line, if it is Discount it will be
subtracted from it.
- Specified by:
calculate in class CalculationLine
- Parameters:
sheets - The sheets being evaluatedsheet - The sheet that this line is a member of.
- Returns:
- always true. FixedSum lines cannot fail to calculate.