CLRA 0.1.2

com.clra.web
Class MemberSet

java.lang.Object
  |
  +--com.clra.web.MemberSet
All Implemented Interfaces:
INameList

public class MemberSet
extends 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.2 $ $Date: 2002/02/18 18:06:26 $
Author:
Rick Hall

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(Integer group)
          Prepares a restricted iterator for the specified group of the current year
 
Method Summary
 Iterator getAllActiveMembers()
          Deprecated.  
 ISerializableComparator getComparator()
          Stubbed method that returns null
 Integer getGroup()
          Returns the group used by restricted iterations
 Iterator getIterator()
          Returns an iterator constructed to the current setting
 Boolean getRestricted()
          Returns a flag that indicates whether an iterator will be restricted to a particular group of names.
 void setComparator(ISerializableComparator comparator)
          Stubbed method that does nothing
 void setGroup(Integer group)
          Sets the month used by restricted iterations
 void setRestricted(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
 

Constructor Detail

MemberSet

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

MemberSet

public MemberSet(Integer group)
          throws WebException
Prepares a restricted iterator for the specified group of the current year
Method Detail

getRestricted

public 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(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 Integer getGroup()
Returns the group used by restricted iterations
Specified by:
getGroup in interface INameList

setGroup

public void setGroup(Integer group)
Sets the month used by restricted iterations
Specified by:
setGroup in interface INameList

getComparator

public ISerializableComparator getComparator()
Stubbed method that returns null
Specified by:
getComparator in interface INameList

setComparator

public void setComparator(ISerializableComparator comparator)
Stubbed method that does nothing
Specified by:
setComparator in interface INameList

getIterator

public Iterator getIterator()
                     throws WebException
Returns an iterator constructed to the current setting
Specified by:
getIterator in interface INameList

getAllActiveMembers

public Iterator getAllActiveMembers()
                             throws MemberException
Deprecated.  

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


CLRA 0.1.2