ptolemy.actor.gt
Interface ValueIterator
- All Superinterfaces:
- Nameable, Settable
- All Known Implementing Classes:
- IterativeParameter
public interface ValueIterator
- extends Settable
An interface for parameters whose accepted values can be iterated from the
initial value with the next method.
- Since:
- Ptolemy II 8.0
- Version:
- $Id: ValueIterator.java 57044 2010-01-27 22:41:05Z cxh $
- Author:
- Thomas Huining Feng
- Accepted Rating:
- Proposed Rating:
Method Summary |
Token |
getToken()
Get the current value of the parameter that implements this interface. |
Token |
initial()
Set the parameter that implements this interface with its initial value,
and return that value. |
Token |
next()
Set the parameter that implements this interface with its next value,
and return that value. |
void |
setToken(Token token)
Set the value of the parameter that implements this interface. |
getToken
Token getToken()
throws IllegalActionException
- Get the current value of the parameter that implements this interface.
- Returns:
- The current value.
- Throws:
IllegalActionException
- Throws if the current value cannot be
obtained.- See Also:
setToken(Token)
initial
Token initial()
throws IllegalActionException
- Set the parameter that implements this interface with its initial value,
and return that value.
- Returns:
- The initial value.
- Throws:
IllegalActionException
- Thrown when trying to compute the
initial value or to set the parameter with that value.
next
Token next()
throws IllegalActionException
- Set the parameter that implements this interface with its next value,
and return that value. If the initial value has not been set with
initial()
, or no next value exists, IllegalActionException
is
thrown.
- Returns:
- The next value, or null.
- Throws:
IllegalActionException
- Thrown when trying to compute the next
value or to set the parameter with that value, or if the initial value
has not been set, or no next value exists.
setToken
void setToken(Token token)
throws IllegalActionException
- Set the value of the parameter that implements this interface. This
method should be used with care because the value may not be one of the
values that can be obtained by repeatedly calling the
next()
method starting from the initial value.
- Parameters:
token
- The value to be set.
- Throws:
IllegalActionException
- Thrown when trying to set the value.- See Also:
getToken()