edu.unh.sdb.lattice
Class LatticeCollection

java.lang.Object
  extended by edu.unh.sdb.lattice.LatticeCollection

public class LatticeCollection
extends java.lang.Object

The LatticeCollection class provides for a list of Lattices with customary list functionality. The list was intended to be populated either by reading a database or by processing some Data Description Language. The list is only allowed to grow. Elements are never deleted from the list.


Constructor Summary
LatticeCollection()
          default constructor
 
Method Summary
 void add(Lattice lattice)
          Add a Lattice to the end of the list
 Lattice get(int i)
          Returns the Lattice at the designated index or null Lattice object if no more exists.
 Lattice get(java.lang.String s)
          Returns the Lattice object corresponding to the Lattice named by the string.
 Lattice getElementAt(int i)
          Returns the Lattice at the designated index or null Lattice object if no more exists.
 Lattice getLattice(java.lang.String s)
          Returns the Lattice object corresponding to the Lattice named by the string
 int indexOf(java.lang.String s)
          Returns the integer index of the Lattice corresponding to the Lattice named by the string.
 int indexOfName(java.lang.String s)
          Returns the integer index value for the Lattice denoted by string.
 void merge(LatticeCollection latticeCollection)
          if name exists in both collections, the new one is discarded
 boolean nameExists(java.lang.String s)
          Returns true if Lattice named by String is in the list
 Lattice next()
          returns the next Lattice object or null Lattice object if no more exists
 void rewind()
          Resets the index to beginning of the list
 int size()
          Returns the number of elements stored this Lattice collection as an integer
 java.lang.String toString()
          for debugging - prints the total number of Lattice collections stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatticeCollection

public LatticeCollection()
default constructor

Method Detail

next

public Lattice next()
returns the next Lattice object or null Lattice object if no more exists


getElementAt

public Lattice getElementAt(int i)
Returns the Lattice at the designated index or null Lattice object if no more exists. Returns a null Lattice object if index does not exist.


get

public Lattice get(int i)
Returns the Lattice at the designated index or null Lattice object if no more exists. Returns a null Lattice object if index does not exist. This is a shorthand method to getElementAt() added for compatibility with SDB naming conventions.


add

public void add(Lattice lattice)
Add a Lattice to the end of the list


rewind

public void rewind()
Resets the index to beginning of the list


indexOfName

public int indexOfName(java.lang.String s)
Returns the integer index value for the Lattice denoted by string. Returns -1 if the Lattice name does not exist


nameExists

public boolean nameExists(java.lang.String s)
Returns true if Lattice named by String is in the list


indexOf

public int indexOf(java.lang.String s)
Returns the integer index of the Lattice corresponding to the Lattice named by the string. If name does not exist, a null Lattice will be returned


getLattice

public Lattice getLattice(java.lang.String s)
Returns the Lattice object corresponding to the Lattice named by the string


get

public Lattice get(java.lang.String s)
Returns the Lattice object corresponding to the Lattice named by the string. This is a shorthand for getLattice(String) to comply with SDB naming conventions.


size

public int size()
Returns the number of elements stored this Lattice collection as an integer


merge

public void merge(LatticeCollection latticeCollection)
if name exists in both collections, the new one is discarded


toString

public java.lang.String toString()
for debugging - prints the total number of Lattice collections stored. Later will give names of each Lattice

Overrides:
toString in class java.lang.Object