backend.domainObjects
Class AccessPointList

java.lang.Object
  extended by backend.domainObjects.AccessPointList

public class AccessPointList
extends java.lang.Object

This class contains an array of access points, and operates quite similarly to the MessageList and APGroupList classes. The list keeps track of its size and capacity while it stores a list of AccessPoint-type objects in an array. It corresponds to the <accesspoints> tag section in XML code. Its parse method looks for <accesspoint> tags and creates new AccessPoint-type objects to correspond to what the parser finds.

Author:
ptm2

Constructor Summary
AccessPointList()
          The default constructor uses the startBlank method to set its capacity to 5, allocate a new array to fit 5 AccessPoint-type objects, and sets the size to 0.
 
Method Summary
 void add(AccessPoint a)
          This method adds an AccessPoint-type object to the array, boosting the capacity if need be.
 AccessPoint at(int i)
          This method returns the AccessPoint in the AccessPointList's array at the given index.
 void fromXML(org.kxml2.io.KXmlParser theParser)
          Like almost all the other XML-parsing methods, this one assumes that a <accesspoints> tag has just been found in the XML code by the parser.
 int size()
          This method returns the size of the AccessPointList---i.e.
 void trim()
          In case we need to save memory, this method will copy everything from the current array into a new array that has a length equal to the size field of the AccessPointList---i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessPointList

public AccessPointList()
The default constructor uses the startBlank method to set its capacity to 5, allocate a new array to fit 5 AccessPoint-type objects, and sets the size to 0.

Method Detail

add

public void add(AccessPoint a)
This method adds an AccessPoint-type object to the array, boosting the capacity if need be. It increases the size of the AccessPointList as is only logical.


size

public int size()
This method returns the size of the AccessPointList---i.e. the number of objects that have been added to it.


trim

public void trim()
In case we need to save memory, this method will copy everything from the current array into a new array that has a length equal to the size field of the AccessPointList---i.e. the array will be just big enough to fit all the objects added to the AccessPointList.


fromXML

public void fromXML(org.kxml2.io.KXmlParser theParser)
Like almost all the other XML-parsing methods, this one assumes that a <accesspoints> tag has just been found in the XML code by the parser. It accepts a KXmlParser from the caller and looks for <accesspoint> tags. If it finds one, it creates a new AccessPoint-type object, feeds the AccessPoint the parser so the access point can fill in its own fields, and then adds the AccessPoint to itself. The parser will continue looking for

at

public AccessPoint at(int i)
This method returns the AccessPoint in the AccessPointList's array at the given index. It does no error-checking for whether the index is in bounds or not.