|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlive.dto.Group
Group is used by the cache to store information about a specific group.
Field Summary | |
private String |
groupName
|
private LinkedList |
members
|
static String |
UNGROUPED_NAME
A constant that defines a placeholder for a group that is actually (ungrouped). |
Constructor Summary | |
Group(String groupName)
Creates a Group and sets its name. |
Method Summary | |
void |
addMember(String guestNameToAdd)
Adds the name of a guest to this group. |
int |
compareTo(Object o)
This allows groups to be ordered by the guest name, so if you have a sorted collection (for instance, and this is by far the motivation) the groups will be in alphabetical order. |
int |
findMember(String guestNameToFind)
Returns the index of guestNameToFind or -1 if it is not present |
String |
getGroupName()
Gets the name of this group. |
LinkedList |
getMemberList()
Returns the whole member list. |
ListIterator |
getMembers()
Returns a ListIterator that can be used to get every guest name that is a
member of this group. |
void |
removeMember(int indexOfMemberToRemove)
Removes the member of the guest list given by the index. |
void |
removeMember(String guestNameToRemove)
Removes the guest from this group given by the parameter. |
void |
setGroupName(String groupName)
Sets the name of this group. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String UNGROUPED_NAME
private String groupName
private LinkedList members
Constructor Detail |
public Group(String groupName)
groupName
- The name of this groupMethod Detail |
public String getGroupName()
public void setGroupName(String groupName)
groupName
- The group name to use.public void addMember(String guestNameToAdd)
guestNameToAdd
- The name of the guest to add to this group.public int findMember(String guestNameToFind)
guestNameToFind
- The name of the guest we are looking for in the
list.
public void removeMember(String guestNameToRemove)
guestNameToRemove
- The guest to remove from this group.public void removeMember(int indexOfMemberToRemove)
indexOfMemberToRemove
- Index of the guest we wish to remove from
the list.public ListIterator getMembers()
ListIterator
that can be used to get every guest name that is a
member of this group. Be careful of synchronization, especially as
THIS CLASS DOESN'T.
ListIterator
used to iterate over this list.public LinkedList getMemberList()
LinkedList
of members.public int compareTo(Object o)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |