com.ail.insurance.policy
Class Behaviour

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.Behaviour
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AssessmentLine>
Direct Known Subclasses:
RateBehaviour, SumBehaviour

public abstract class Behaviour
extends CalculationLine

A behaviour is a type of assessment line, specifically one that has an effect on a calculated amount. A behaviour may "load" or "discount" and may do so with relation to a "rate" or a fixed sum. The behaviour's type gives more detail about the behaviour, e.g. is it a loading, a discount, a tax, etc.

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

Field Summary
 
Fields inherited from class com.ail.core.Type
jXPathContext, NOT_PERSISTED
 
Constructor Summary
Behaviour()
          Default constructor
Behaviour(java.lang.String id, java.lang.String reason, Reference relatesTo, java.lang.String contributesTo, BehaviourType type)
          Constructor
Behaviour(java.lang.String id, java.lang.String reason, Reference relatesTo, java.lang.String contributesTo, BehaviourType type, CurrencyAmount amount)
          Constructor
Behaviour(java.lang.String id, java.lang.String reason, Reference relatesTo, java.lang.String contributesTo, BehaviourType type, CurrencyAmount amount, int priority)
          Constructor
Behaviour(java.lang.String id, java.lang.String reason, Reference relatesTo, java.lang.String contributesTo, BehaviourType type, int priority)
          Constructor
 
Method Summary
 BehaviourType getType()
          Get the value of the type property.
 java.lang.String getTypeAsString()
          Get the current value of the type property as a String.
 void setType(BehaviourType type)
          Set the type property.
 void setTypeAsString(java.lang.String type)
          Set the type property from a String.
 
Methods inherited from class com.ail.insurance.policy.CalculationLine
calculate, 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

Behaviour

public Behaviour()
Default constructor


Behaviour

public Behaviour(java.lang.String id,
                 java.lang.String reason,
                 Reference relatesTo,
                 java.lang.String contributesTo,
                 BehaviourType type,
                 CurrencyAmount amount)
Constructor

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 line contributes to.
type - The type of behaviour being represented.
amount - The amount (value) represented by this line.

Behaviour

public Behaviour(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 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 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)

Behaviour

public Behaviour(java.lang.String id,
                 java.lang.String reason,
                 Reference relatesTo,
                 java.lang.String contributesTo,
                 BehaviourType type)
Constructor

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 line contributes to.
type - The type of behaviour being represented.

Behaviour

public Behaviour(java.lang.String id,
                 java.lang.String reason,
                 Reference relatesTo,
                 java.lang.String contributesTo,
                 BehaviourType type,
                 int priority)
Constructor

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 line contributes to.
type - The type of behaviour being represented.
priority - The priority of this line wrt other lines in the same sheet (lines with higher priority values are processed first)
Method Detail

setType

public void setType(BehaviourType type)
Set the type property. The type property describes type of behaviour being represented (e.g. Load, Discount).

Parameters:
type - New value for type property.

setTypeAsString

public void setTypeAsString(java.lang.String type)
Set the type property from a String. The type property describes type of behaviour being represented (e.g. Load, Discount). The argument passed must represent a valid value for calling BehaviourType.forName(arg).

Parameters:
type - New value for type property.
Throws:
java.lang.IndexOutOfBoundsException - If type is not a valid string representation of BehaviourType.
See Also:
BehaviourType.forName(java.lang.String), setType(com.ail.insurance.policy.BehaviourType)

getType

public BehaviourType getType()
Get the value of the type property. The type property describes type of behaviour being represented (e.g. Load, Discount).

Returns:
Value of type

getTypeAsString

public java.lang.String getTypeAsString()
Get the current value of the type property as a String.

Returns:
Value of type property as a String, or null if type is null.
See Also:
getType()