CLRA 0.1.2

com.clra.web
Class EnrollmentView

java.lang.Object
  |
  +--com.clra.web.EnrollmentView
All Implemented Interfaces:
Comparable, Serializable

public class EnrollmentView
extends Object
implements Comparable, Serializable

Read-only information about enrollment of a member in a rowing session. A thin wrapper around EnrollmentSnapshot. Adds value by defining a natural order for presenting enrollment snapshots.

Version:
$Revision: 1.2 $ $Date: 2002/02/18 18:05:56 $
Author:
Rick Hall
See Also:
Serialized Form

Constructor Summary
EnrollmentView()
          Produces an invalid EnrollmentView.
EnrollmentView(EnrollmentSnapshot es)
           
 
Method Summary
 int compareTo(Object o)
          Defines a natural ordering for enrollments by using the natural order of MemberId, then SessionView, then by id of ParticipantView.
 boolean equals(Object o)
          Two enrollments are equal iff their components are equal.
 EnrollmentSnapshot getData()
           
 String getEnrollmentStatus()
          Enrollment status is a derived value.
 Integer getMemberId()
           
 ParticipantView getParticipantView()
          May be null
 SessionView getSessionView()
           
 int hashCode()
          Member objects are hashed by id's
 void setData(EnrollmentSnapshot es)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnrollmentView

public EnrollmentView()
Produces an invalid EnrollmentView. Used only by JSP's

EnrollmentView

public EnrollmentView(EnrollmentSnapshot es)
Parameters:
es - a non-null EnrollmentSnapshot
Method Detail

setData

public void setData(EnrollmentSnapshot es)

getData

public EnrollmentSnapshot getData()

getMemberId

public Integer getMemberId()

getSessionView

public SessionView getSessionView()

getParticipantView

public ParticipantView getParticipantView()
May be null

getEnrollmentStatus

public String getEnrollmentStatus()
Enrollment status is a derived value. It does not correspond to the state of any persistent entity. Rather, it reflects the state of several entities, in a somewhat arbitrary manner. It conveys useful information to the user, but because multiple entity states can map to a single enrollment status, it should not be used except for presentation.

FIXME: even though this algorithm is intended for just presenatation, it is closely related to business rules for invoicing members and for balancing "bumps" among members. When those rules are coded, this method should be rewritten in terms of those algorithms.

Returns:
a non-null, but possibly blank String.

equals

public boolean equals(Object o)
Two enrollments are equal iff their components are equal.
Overrides:
equals in class Object

hashCode

public int hashCode()
Member objects are hashed by id's
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
              throws ClassCastException
Defines a natural ordering for enrollments by using the natural order of MemberId, then SessionView, then by id of ParticipantView.
Specified by:
compareTo in interface Comparable
Parameters:
o - an EnrollmentView
Throws:
ClassCastException - if o is not a enrollment view.

CLRA 0.1.2