live.dto
Class NameList

java.lang.Object
  extended bylive.dto.NameList

public class NameList
extends Object

Stores the elements of a name list. This is essentially the same as Group, but is made a separate type so as to not muddle the purpose of Group with different uses, because NameLists are not guranteed to have a list of Guest names, just a list of Strings that may or may not have any meaning.

Author:
Evan Driscoll

Field Summary
private  LinkedList elements
           
private  String listName
           
 
Constructor Summary
NameList(String listName)
          Creates a List and sets its name.
 
Method Summary
 void addElement(String elementToAdd)
          Adds an element to this list.
 LinkedList getElements()
          Returns the list of elements.
 String getListName()
          Gets the name of this list.
 Iterator iterator()
          An iterator into the elements in the list.
 ListIterator listIterator()
          Returns a ListIterator that can be used to get every element of the list.
 void setListName(String listName)
          Sets the name of this group.
 String toString()
          Returns a readable version of the list in the format: [List name: [member, member, ...]]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

listName

private String listName

elements

private LinkedList elements
Constructor Detail

NameList

public NameList(String listName)
Creates a List and sets its name.

Parameters:
listName - The name of this list
Method Detail

getListName

public String getListName()
Gets the name of this list.

Returns:
Name of this list.

setListName

public void setListName(String listName)
Sets the name of this group.

Parameters:
listName - The group name to use.

addElement

public void addElement(String elementToAdd)
Adds an element to this list.

Parameters:
elementToAdd - The element to add to this list.

listIterator

public ListIterator listIterator()
Returns a ListIterator that can be used to get every element of the list. Careful of synchronization.

Returns:
The ListIterator used to iterate over this list.

iterator

public Iterator iterator()
An iterator into the elements in the list. Careful of synchronization.

Returns:
An Iterator into the list of elements

getElements

public LinkedList getElements()
Returns the list of elements. Careful of synchronization.

Returns:
The list of arguments

toString

public String toString()
Returns a readable version of the list in the format: [List name: [member, member, ...]]

Returns:
A string version of NameList in the format above
See Also:
Object.toString()


Copyright © 2005