Class GuardCriterion


  • public class GuardCriterion
    extends Criterion
    A criterion to constrain a guard of a transition in an FSM or a Ptera controller.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Thomas Huining Feng
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Yellow (tfeng)
    • Constructor Detail

      • GuardCriterion

        public GuardCriterion​(GTIngredientList owner)
        Construct a criterion within the given list as its owner. All elements are enabled and are initialized to empty at the beginning.
        Parameters:
        owner - The list as the owner of the constructed GTIngredientList.
      • GuardCriterion

        public GuardCriterion​(GTIngredientList owner,
                              java.lang.String values)
        Construct a criterion within the given list as its owner and initialize all the elements with the given values, which are a string encoding of those elements. All elements are enabled at the beginning.
        Parameters:
        owner - The list as the owner of the constructed GTIngredientList.
        values - The string encoding of the values of the elements.
    • Method Detail

      • getValue

        public java.lang.Object getValue​(int index)
        Get the value of the index-th elements.
        Specified by:
        getValue in class GTIngredient
        Parameters:
        index - The index.
        Returns:
        The value.
        See Also:
        setValue(int, Object)
      • getValues

        public java.lang.String getValues()
        Get a string that describes the values of all the elements.
        Specified by:
        getValues in class GTIngredient
        Returns:
        A string that describes the values of all the elements.
        See Also:
        setValues(String)
      • isApplicable

        public boolean isApplicable​(NamedObj object)
        Check whether this GTIngredient is applicable to the object.
        Overrides:
        isApplicable in class GTIngredient
        Parameters:
        object - The object.
        Returns:
        true if this GTIngredient is applicable; false otherwise.
      • match

        public boolean match​(NamedObj object)
        Return whether this criterion can check the given object.
        Specified by:
        match in class Criterion
        Parameters:
        object - The object.
        Returns:
        true if the object can be checked.
      • setValue

        public void setValue​(int index,
                             java.lang.Object value)
        Set the value of the index-th element.
        Specified by:
        setValue in class GTIngredient
        Parameters:
        index - The index.
        value - The value.
        See Also:
        getValue(int)
      • setValues

        public void setValues​(java.lang.String values)
        Set the values of all the elements with a string that describes them.
        Specified by:
        setValues in class GTIngredient
        Parameters:
        values - A string that describes the new values of all the elements.
        See Also:
        getValues()