com.kpro.dataobjects
Class Case

java.lang.Object
  extended by com.kpro.dataobjects.Case
All Implemented Interfaces:
java.lang.Comparable

public class Case
extends java.lang.Object
implements java.lang.Comparable

A class that contains a single datatype from a PolicyObject.

Author:
ernie

Field Summary
private  java.util.ArrayList<Category> categories
           
private  java.lang.String datatype
           
private  java.util.ArrayList<Purpose> purpose
           
private  java.util.ArrayList<Recipient> recipient
           
private  java.util.ArrayList<Retention> retention
           
 
Constructor Summary
Case()
           
Case(java.util.ArrayList<Purpose> purpose, java.util.ArrayList<Retention> retention, java.util.ArrayList<Recipient> recipients, java.util.ArrayList<Category> categories, java.lang.String datatype)
           
 
Method Summary
 void addCategory(Category c)
          Adds a category to the case
 void addPurpose(Purpose p)
          Adds a purpose to the case
 void addRecipient(Recipient r)
          Adds a recipient to the case
 void addRetention(Retention t)
          Adds a retention to the case
 int compareTo(java.lang.Object o)
          to allow comparision of cases, primarily for white/blacklisting.
 java.util.ArrayList<Category> getCategories()
          Gets the categories
 Category getCategory(int i)
          Returns the ith category
 java.lang.String getDataType()
          Returns the datatype
 Purpose getPurpose(int i)
          Returns the ith purpose
 java.util.ArrayList<Purpose> getPurposes()
          Gets the purposes
 Recipient getRecipient(int i)
          Returns the ith recipient
 java.util.ArrayList<Recipient> getRecipients()
          Gets the recipients
 Retention getRetention(int i)
          Returns the ith retention
 java.util.ArrayList<Retention> getRetentions()
          Gets the retentions
 void setDataType(java.lang.String s)
          Sets the datatype to the case
 java.lang.String toString()
          Based on debug.print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

purpose

private java.util.ArrayList<Purpose> purpose

retention

private java.util.ArrayList<Retention> retention

recipient

private java.util.ArrayList<Recipient> recipient

categories

private java.util.ArrayList<Category> categories

datatype

private java.lang.String datatype
Constructor Detail

Case

public Case()

Case

public Case(java.util.ArrayList<Purpose> purpose,
            java.util.ArrayList<Retention> retention,
            java.util.ArrayList<Recipient> recipients,
            java.util.ArrayList<Category> categories,
            java.lang.String datatype)
Method Detail

addPurpose

public void addPurpose(Purpose p)
Adds a purpose to the case

Parameters:
p -

addRetention

public void addRetention(Retention t)
Adds a retention to the case

Parameters:
t -

addRecipient

public void addRecipient(Recipient r)
Adds a recipient to the case

Parameters:
r -

addCategory

public void addCategory(Category c)
Adds a category to the case

Parameters:
c -

setDataType

public void setDataType(java.lang.String s)
Sets the datatype to the case

Parameters:
s -

getPurposes

public java.util.ArrayList<Purpose> getPurposes()
Gets the purposes

Returns:
ArrayList

getPurpose

public Purpose getPurpose(int i)
Returns the ith purpose

Parameters:
int - i
Returns:
Purpose

getRetentions

public java.util.ArrayList<Retention> getRetentions()
Gets the retentions

Returns:
ArrayList

getRetention

public Retention getRetention(int i)
Returns the ith retention

Parameters:
int - i
Returns:
Retention

getRecipients

public java.util.ArrayList<Recipient> getRecipients()
Gets the recipients

Returns:
ArrayList

getRecipient

public Recipient getRecipient(int i)
Returns the ith recipient

Parameters:
int - i
Returns:
Recipient

getCategories

public java.util.ArrayList<Category> getCategories()
Gets the categories

Returns:
ArrayList

getCategory

public Category getCategory(int i)
Returns the ith category

Parameters:
int - i
Returns:
Category

getDataType

public java.lang.String getDataType()
Returns the datatype

Returns:
String

toString

public java.lang.String toString()
Based on debug.print

Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
to allow comparision of cases, primarily for white/blacklisting.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
another - object (a case)
Returns:
-1 if this > other, 0 if equal, else 1