Package ptolemy.actor.gt
Interface ValueIterator
-
- 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$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
Field Summary
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
-
Methods inherited from interface ptolemy.kernel.util.Settable
addValueListener, getDefaultExpression, getDisplayName, getExpression, getValueAsString, getVisibility, removeValueListener, setExpression, setVisibility, validate
-
-
-
-
Method Detail
-
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 withinitial()
, 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 thenext()
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()
-
-