evolution
Class InfoList


public class InfoList

A list of information. This type of list is returned from World.getSquareInfo() World.getHumanInfo() World.getConstructionInfo() World.getActionsInfo() World.getConstructionsInfo() World.getResourcesInfo()


Field Summary
 protected final static BooleanbF
          A cached Boolean false value.
 final static intBOOLEAN
          The Boolean type.
 protected final static BooleanbT
          A cached Boolean true value.
 final static intPERCENTAGE
          The Percentage type.
 final static intSTRING
          The formatted String type.
 final static intVALUE
          The Value type.

Constructor Summary
InfoList()
          Create a new empty InfoList.

Method Summary
 voidadd(String name, int type, String value)
          Add an element to this InfoList.
 voidadd(String name, int type, boolean value)
          Add an element to this InfoList.
 voidadd(String name, int type, double value)
          Add an element to this InfoList.
 booleangetBoolean()
          Get the BOOLEAN value of the current record.
 StringgetName()
          Get the name of the current record.
 doublegetPercentage()
          Get the PERCENTAGE value of the current record.
 StringgetString()
          Get the STRING value of the current record.
 intgetType()
          Get the type of the current record.
 doublegetValue()
          Get the VALUE value of the current record.
 static voidmain(String[] args)
          Test program.
 booleannext()
          Iterate to the next element.
 voidprint()
          For debugging, print to stdout.
 voidreset()
          Reset the iterator.

Field Detail

bF

protected final static Boolean bF
A cached Boolean false value.

BOOLEAN

public final static int BOOLEAN
The Boolean type.

bT

protected final static Boolean bT
A cached Boolean true value.

PERCENTAGE

public final static int PERCENTAGE
The Percentage type.

STRING

public final static int STRING
The formatted String type.

VALUE

public final static int VALUE
The Value type.
Constructor Detail

InfoList

public InfoList()
Create a new empty InfoList.
Method Detail

add

public void add(String name, int type, String value)
Add an element to this InfoList. The list will be reset after the element is added. Precondition: type must be a valid type.

add

public void add(String name, int type, boolean value)
Add an element to this InfoList. The list will be reset after the element is added. Precondition: type must be a valid type.

add

public void add(String name, int type, double value)
Add an element to this InfoList. The list will be reset after the element is added. Precondition: type must be a valid type.

getBoolean

public boolean getBoolean()
throws java.util.NoSuchElementException
Get the BOOLEAN value of the current record.
excpetion NoSuchElementException If this InfoList is not pointing to an element.

getName

public String getName()
throws java.util.NoSuchElementException
Get the name of the current record.
excpetion NoSuchElementException If this InfoList is not pointing to an element.

getPercentage

public double getPercentage()
throws java.util.NoSuchElementException
Get the PERCENTAGE value of the current record.
excpetion NoSuchElementException If this InfoList is not pointing to an element.

getString

public String getString()
throws java.util.NoSuchElementException
Get the STRING value of the current record.
excpetion NoSuchElementException If this InfoList is not pointing to an element.

getType

public int getType()
throws java.util.NoSuchElementException
Get the type of the current record. This is one of the public static final fields of this class. STRING, PERCENTAGE, BOOLEAN, VALUE
excpetion NoSuchElementException If this InfoList is not pointing to an element.

getValue

public double getValue()
throws java.util.NoSuchElementException
Get the VALUE value of the current record.
excpetion NoSuchElementException If this InfoList is not pointing to an element.

main

public static void main(String[] args)
throws java.lang.Exception
Test program.

next

public boolean next()
Iterate to the next element.
Returns: true if the InfoList now points to the next element, false if there are no more elements.

print

public void print()
For debugging, print to stdout.

reset

public void reset()
Reset the iterator.

Association Links

to Class java.util.List

A list which holds all the records in this InfoList.

to Class java.util.Iterator

An iterator on this InfoList.

a gvijf production