Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.clra.web
Class MemberSet  view MemberSet download MemberSet.java

java.lang.Object
  extended bycom.clra.web.MemberSet
All Implemented Interfaces:
INameList

public class MemberSet
extends java.lang.Object
implements INameList

A JSP bean that provides ordered lists of MemberViews. This class is a thin wrapper around calls to MemberDBRead. In the future, it might add further value by caching and sorting views on the client side.

FIXME: this class is basically a list, not a set. A set hides duplicates, whereas a list does not. Rename this class.

FIXME: this class could be less tightly coupled to the GUI, by using String properties lowerBound and upperBound. If both lowerBound and upperBound are non-null, then select for lowerBound <= names < upperBound. If lowerBound is null, then select for names < upperBound. If upperBound is null, then select for lowerBound <= names. If both are null, throw an IllegalStateException.

In the current implementation, a list is created on the fly whenever a JSP is displayed, and the list is tossed after the page is written. For lists of 60 or so items, a page will update in 2 - 3 seconds when the app and web servers are lightly loaded. This is adequate performance, since most lists will be restricted by name, and therefore will contain roughly 40 (==300/8) items.

Version:
$Revision: 1.4 $ $Date: 2003/02/26 03:38:46 $

Field Summary
private static java.lang.String base
           
private static java.lang.Integer DEFAULT_GROUP_INDEX
           
private  java.lang.Integer group
          Holds the group index that specifies which names should be displayed.
private  java.lang.Boolean restricted
          Holds the restriction flag
private static org.apache.log4j.Category theLog
           
 
Fields inherited from interface com.clra.web.INameList
AN_COMPARATOR, AN_GROUP, AN_ISRESTRICTED
 
Constructor Summary
MemberSet()
          Prepares a restricted iterator for the current group and year
MemberSet(java.lang.Integer group)
          Prepares a restricted iterator for the specified group of the current year
 
Method Summary
(package private)  java.util.Collection findMemberSnapshots(java.lang.Integer group)
          Returns a collection of member snapshots based on the current group.
 java.util.Iterator getAllActiveMembers()
          Deprecated.  
 com.clra.util.ISerializableComparator getComparator()
          Stubbed method that returns null
 java.lang.Integer getGroup()
          Returns the group used by restricted iterations
 java.util.Iterator getIterator()
          Returns an iterator constructed to the current setting
(package private)  java.lang.String getLowerBound(java.lang.Integer group)
          Calculates the lower bound of names in a group
 java.lang.Boolean getRestricted()
          Returns a flag that indicates whether an iterator will be restricted to a particular group of names.
(package private)  java.lang.String getUpperBound(java.lang.Integer group)
          Calculates the uppder bound of names in a group
 void setComparator(com.clra.util.ISerializableComparator comparator)
          Stubbed method that does nothing
 void setGroup(java.lang.Integer group)
          Sets the month used by restricted iterations
 void setRestricted(java.lang.Boolean restricted)
          Sets whether an iterator will be restricted to names within a within a group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

private static final java.lang.String base

theLog

private static final org.apache.log4j.Category theLog

DEFAULT_GROUP_INDEX

private static final java.lang.Integer DEFAULT_GROUP_INDEX

restricted

private java.lang.Boolean restricted
Holds the restriction flag


group

private java.lang.Integer group
Holds the group index that specifies which names should be displayed. By default, this group is ABC (index 2).

Constructor Detail

MemberSet

public MemberSet()
          throws WebException
Prepares a restricted iterator for the current group and year


MemberSet

public MemberSet(java.lang.Integer group)
          throws WebException
Prepares a restricted iterator for the specified group of the current year

Method Detail

getRestricted

public java.lang.Boolean getRestricted()
Returns a flag that indicates whether an iterator will be restricted to a particular group of names.

Specified by:
getRestricted in interface INameList

setRestricted

public void setRestricted(java.lang.Boolean restricted)
Sets whether an iterator will be restricted to names within a within a group. A null values does not change the current restriction.

Specified by:
setRestricted in interface INameList

getGroup

public java.lang.Integer getGroup()
Returns the group used by restricted iterations

Specified by:
getGroup in interface INameList

setGroup

public void setGroup(java.lang.Integer group)
Sets the month used by restricted iterations

Specified by:
setGroup in interface INameList

getComparator

public com.clra.util.ISerializableComparator getComparator()
Stubbed method that returns null

Specified by:
getComparator in interface INameList

setComparator

public void setComparator(com.clra.util.ISerializableComparator comparator)
Stubbed method that does nothing

Specified by:
setComparator in interface INameList

getIterator

public java.util.Iterator getIterator()
                               throws WebException
Returns an iterator constructed to the current setting

Specified by:
getIterator in interface INameList

findMemberSnapshots

java.util.Collection findMemberSnapshots(java.lang.Integer group)
                                   throws com.clra.member.MemberException
Returns a collection of member snapshots based on the current group.


getLowerBound

java.lang.String getLowerBound(java.lang.Integer group)
Calculates the lower bound of names in a group


getUpperBound

java.lang.String getUpperBound(java.lang.Integer group)
Calculates the uppder bound of names in a group


getAllActiveMembers

public java.util.Iterator getAllActiveMembers()
                                       throws com.clra.member.MemberException
Deprecated.  

Finds all active members of the CLRA. Members are sorted by lastname-firstname (the natural comparator for members).