cnrg.itx.ds
Class LocationList

java.lang.Object
  |
  +--cnrg.itx.ds.LocationList
Direct Known Subclasses:
CustomLocation

public class LocationList
extends java.lang.Object

This class represents a list of locations.


Field Summary
private  Element m_current
           
private  Element m_head
           
private  Element m_tail
           
 
Constructor Summary
LocationList()
          Default constructor
LocationList(LocationList newLocationList)
          Copy constructor
 
Method Summary
 void add(Location newLocation)
          Add a new element to the end of the list
 void add(LocationList newLocationList)
          Add the given location list to the end of the list
 int count()
          Get the number of elements.
 Location first()
          Get the first element (also Reset to the first element position)
 Location getAt(int index)
          Get the element at a particular position (zero-based index)
 Location next()
          Get the next element.
 void removeAll()
          Remove all the elements from the location list object
 void reset()
          Reset to the first element position
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_head

private Element m_head

m_tail

private Element m_tail

m_current

private Element m_current
Constructor Detail

LocationList

public LocationList()
Default constructor

LocationList

public LocationList(LocationList newLocationList)
Copy constructor
Parameters:
newLocationList - an input location list object
Method Detail

removeAll

public void removeAll()
Remove all the elements from the location list object

count

public int count()
Get the number of elements. Zero implies empty list.
Returns:
number of elements

reset

public void reset()
Reset to the first element position

first

public Location first()
Get the first element (also Reset to the first element position)
Returns:
the first location object in the list

next

public Location next()
Get the next element. Returms NULL if call Next on the last element.
NOTE: To traverse the list from the beginning, call first(), then calling next() to traverse to the end of the list
Returns:
the next location object in the list

add

public void add(Location newLocation)
Add a new element to the end of the list
Parameters:
newLocation - the new location object to be added to the list

add

public void add(LocationList newLocationList)
Add the given location list to the end of the list
Parameters:
newLocationList - the new location list to be added to the list

getAt

public Location getAt(int index)
Get the element at a particular position (zero-based index)
Parameters:
index - the index of the element to be retrieved
Returns:
the element at the given position. NULL if the given position is out of range.