com.ail.insurance.policy
Class AssessmentSheetList

java.lang.Object
  extended by com.ail.insurance.policy.AssessmentSheetList

public class AssessmentSheetList
extends java.lang.Object

This helper class simplifies the process of mapping assessment line ids to the lines themselves.

Each

Version:
$Revision: 1.2 $

Constructor Summary
AssessmentSheetList(Policy policy)
           
 
Method Summary
 void addAssessmentLine(AssessmentLine line, AssessmentSheet current)
          Add an assessment line.
 AssessmentLine findAssessmentLine(java.lang.String longId)
          Find the assessment line with the long name specified
 AssessmentLine findAssessmentLine(java.lang.String id, AssessmentSheet current)
          Find a line by long or short id.
 java.util.Collection<AssessmentSheet> getSheets()
          Return a collection of sheets.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssessmentSheetList

public AssessmentSheetList(Policy policy)
Method Detail

findAssessmentLine

public AssessmentLine findAssessmentLine(java.lang.String longId)
Find the assessment line with the long name specified

Parameters:
longId -
Returns:
The AssessmentLine found, or null if none is found.

findAssessmentLine

public AssessmentLine findAssessmentLine(java.lang.String id,
                                         AssessmentSheet current)
Find a line by long or short id. If the line cannot be found as a long id (using findAssessmentLine), this method will attempt to find the line as a short name in the current Assessment Sheet.

Parameters:
id - Line Id to search for.
current - Current assessment sheet - used if id is a short name.
Returns:
The assessment line found, or null if none is found.

addAssessmentLine

public void addAssessmentLine(AssessmentLine line,
                              AssessmentSheet current)
                       throws java.lang.IllegalArgumentException
Add an assessment line. The line's Id may be in long or short form. If it is in long form, the appropriate sheet will be added to (the line added will have a short Id). If it is in short form, it is added to the current sheet.

Parameters:
line - Line to be addded
current - Current assessment sheet.
Throws:
java.lang.IllegalArgumentException - If the name is in long form, and a sheet by the name cannot be found.

getSheets

public java.util.Collection<AssessmentSheet> getSheets()
Return a collection of sheets.

Returns:
Collection of instances of AssessmentSheet.