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$
    Author:
    Thomas Huining Feng
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Yellow (tfeng)
    • Method Detail

      • 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()