uchicago.src.sim.parameter.rpl
Class ListRPLParameter

java.lang.Object
  extended by uchicago.src.sim.parameter.rpl.AbstractRPLParameter
      extended by uchicago.src.sim.parameter.rpl.AbstractDynamicParameter
          extended by uchicago.src.sim.parameter.rpl.ListRPLParameter
All Implemented Interfaces:
RPLParameter

public class ListRPLParameter
extends AbstractDynamicParameter

Defines a parameter whose values are drawn from a list. Calling "next" on this parameter will increment the list index to the next item in the list.

Version:
$Revision: 1.7 $ $Date: 2004/10/19 18:12:55 $

Field Summary
 
Fields inherited from class uchicago.src.sim.parameter.rpl.AbstractRPLParameter
childConsts, childParams, convertor, curIndex, getMethod, name, setMethod, type
 
Constructor Summary
ListRPLParameter(java.lang.String name, RPLList list)
          Creates a ListRPLParameter with the specified name and from the specified RPLList.
 
Method Summary
protected  java.lang.Object getValue()
          Gets the current value of this ListRPLParameter.
protected  boolean incrementSelf()
          Sets the curernt value of this ListRPLParameter to the next item in its list.
protected  void invokeSet(SimModel model)
          Invokes the model's appropriate set method with the value of the current item of this list as an argument.
 void reset()
          Resets the current value of this ListRPLParameter to the first item in its list of items.
 java.lang.String toString()
           
 
Methods inherited from class uchicago.src.sim.parameter.rpl.AbstractDynamicParameter
addToParent, next
 
Methods inherited from class uchicago.src.sim.parameter.rpl.AbstractRPLParameter
addChildConstant, addChildParameter, constantIterator, getName, getValue, parameterIterator, setModelParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListRPLParameter

public ListRPLParameter(java.lang.String name,
                        RPLList list)
Creates a ListRPLParameter with the specified name and from the specified RPLList.

Parameters:
name - the name of the parameter
list - the list of values contained by this parameter
Method Detail

invokeSet

protected void invokeSet(SimModel model)
                  throws RepastException
Invokes the model's appropriate set method with the value of the current item of this list as an argument.

Specified by:
invokeSet in class AbstractRPLParameter
Parameters:
model - the model to invoke the set method on
Throws:
RepastException - if the invocation fails

incrementSelf

protected boolean incrementSelf()
Sets the curernt value of this ListRPLParameter to the next item in its list. Returns true if there is a next item otherwise false if we are at the end of the list.

Specified by:
incrementSelf in class AbstractDynamicParameter
Returns:
Returns true if there is a next item otherwise false if we are at the end of the list.

reset

public void reset()
Resets the current value of this ListRPLParameter to the first item in its list of items.

Specified by:
reset in interface RPLParameter
Overrides:
reset in class AbstractDynamicParameter

getValue

protected java.lang.Object getValue()
Gets the current value of this ListRPLParameter.

Specified by:
getValue in class AbstractRPLParameter
Returns:
the value of this parameter.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object