org.jostraca.unit
Class BasicUnitList

java.lang.Object
  extended byorg.jostraca.unit.BasicUnitList
All Implemented Interfaces:
UnitList

public class BasicUnitList
extends java.lang.Object
implements UnitList

See Also:
UnitList

Field Summary
static java.lang.String CN
           
protected  int iIndex
           
protected  java.util.Vector iUnitList
           
 
Constructor Summary
BasicUnitList()
           
 
Method Summary
 void add(Unit pUnit)
          Add a unit, nulls are ignored
 int getNumUnits()
          Return number of Units.
 Unit getUnit()
          Return current Unit.
 Unit getUnit(int pIndex)
          Return current Unit at index.
 int getUnitIndex()
          Return current index in list of Units.
 boolean nextUnit()
          Return true if their are more Units, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CN

public static final java.lang.String CN
See Also:
Constant Field Values

iIndex

protected int iIndex

iUnitList

protected java.util.Vector iUnitList
Constructor Detail

BasicUnitList

public BasicUnitList()
Method Detail

nextUnit

public boolean nextUnit()
Description copied from interface: UnitList
Return true if their are more Units, false otherwise. Contract: wraps back to the start after returning false once.

Specified by:
nextUnit in interface UnitList
See Also:
org.jostraca.unit

getUnit

public Unit getUnit()
Description copied from interface: UnitList
Return current Unit. Contract: does not return null, throws IllegalStateException() if nextUnit not called

Specified by:
getUnit in interface UnitList
See Also:
org.jostraca.unit

getUnit

public Unit getUnit(int pIndex)
Description copied from interface: UnitList
Return current Unit at index. Contract: does not return null for valid index, otherwise ArrayIndexOutOfBounds at Runtime

Specified by:
getUnit in interface UnitList
Parameters:
pIndex - index of unit
See Also:
org.jostraca.unit

getNumUnits

public int getNumUnits()
Description copied from interface: UnitList
Return number of Units. Contract: returns >= 0.

Specified by:
getNumUnits in interface UnitList
See Also:
org.jostraca.unit

getUnitIndex

public int getUnitIndex()
Description copied from interface: UnitList
Return current index in list of Units. Contract: returns >= 0, < getNumUnits, throws IllegalStateException() if nextUnit not called

Specified by:
getUnitIndex in interface UnitList
See Also:
org.jostraca.unit

add

public void add(Unit pUnit)
Add a unit, nulls are ignored



Copyright © 2000-2002 Richard Rodger