Class ConceptFunctionInequalityTerm

  • All Implemented Interfaces:
    InequalityTerm

    public class ConceptFunctionInequalityTerm
    extends java.lang.Object
    implements InequalityTerm
    An inequality term wrapper for concept functions that are used for ontology constraints. Use this class to set up inequality constraints between variables and concept functions.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Charles Shelton
    Pt.AcceptedRating:
    Red (cshelton)
    Pt.ProposedRating:
    Green (cshelton)
    • Constructor Detail

      • ConceptFunctionInequalityTerm

        public ConceptFunctionInequalityTerm​(ConceptFunction conceptFunction,
                                             InequalityTerm[] inputTerms)
                                      throws IllegalActionException
        Initialize the inequality term with the ConceptFunction it refers to and the array of inequality terms that are inputs to the function.
        Parameters:
        conceptFunction - The concept function to be called to get the value for this inequality term.
        inputTerms - The array of inequality term inputs to the concept function.
        Throws:
        IllegalActionException - If the number of input terms does not match the required number of arguments for the concept function.
    • Method Detail

      • getAssociatedObject

        public java.lang.Object getAssociatedObject()
        Return the concept function associated with this concept function inequality term.
        Specified by:
        getAssociatedObject in interface InequalityTerm
        Returns:
        The concept function evaluated by this concept function inequality term.
      • getConstants

        public final InequalityTerm[] getConstants()
        Return an array of constants contained in this term. Since this term represents a function, return an array containing all the Concept constants in the function.
        Returns:
        An array of InequalityTerms
      • getDependentTerms

        public final InequalityTerm[] getDependentTerms()
        Return the array of dependent terms contained by this term. For a ConceptFunctionInequalityTerm, these terms represent the input arguments to the concept function in the order they are passed to the function.
        Returns:
        An array of InequalityTerms that represent the dependent terms.
      • getValue

        public java.lang.Object getValue()
                                  throws IllegalActionException
        Return the value of this inequality term. Since this term is for a concept function, return the evaluation of the concept function based on the current values of variables passed into the function.
        Specified by:
        getValue in interface InequalityTerm
        Returns:
        An Object representing an element in the underlying CPO.
        Throws:
        IllegalActionException - If the value of this inequality term is not valid.
        See Also:
        setValue(Object)
      • getVariables

        public final InequalityTerm[] getVariables()
        Return the concept variables for this inequality term. This method returns an array of InequalityTerms that the concept function referred to by this ConceptFunctionInequalityTerm depends on.
        Specified by:
        getVariables in interface InequalityTerm
        Returns:
        An array of InequalityTerms.
      • initialize

        public final void initialize​(java.lang.Object e)
                              throws IllegalActionException
        Throw an Exception. This method cannot be called on a function term.
        Specified by:
        initialize in interface InequalityTerm
        Parameters:
        e - The object value used to initialize the inequality term. Since this method always throws an exception, this parameter is never used.
        Throws:
        IllegalActionException - Always thrown.
      • isSettable

        public final boolean isSettable()
        Return false. Concept function terms are not settable.
        Specified by:
        isSettable in interface InequalityTerm
        Returns:
        False.
      • isValueAcceptable

        public boolean isValueAcceptable()
        Return true. Function terms are, by default, always acceptable.
        Specified by:
        isValueAcceptable in interface InequalityTerm
        Returns:
        True.
      • setValue

        public final void setValue​(java.lang.Object e)
                            throws IllegalActionException
        Throw an Exception. The value of a function term cannot be set.
        Specified by:
        setValue in interface InequalityTerm
        Parameters:
        e - The object value to set the inequality term. Since this method always throws an exception, this parameter is never used.
        Throws:
        IllegalActionException - Always thrown.
        See Also:
        getValue()
      • toString

        public java.lang.String toString()
        Override the base class to give a description of this term.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A description of this term.