Package ptolemy.data.ontologies
Class ConceptFunctionInequalityTerm
- java.lang.Object
-
- ptolemy.data.ontologies.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 Summary
Constructors Constructor Description ConceptFunctionInequalityTerm(ConceptFunction conceptFunction, InequalityTerm[] inputTerms)
Initialize the inequality term with the ConceptFunction it refers to and the array of inequality terms that are inputs to the function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAssociatedObject()
Return the concept function associated with this concept function inequality term.InequalityTerm[]
getConstants()
Return an array of constants contained in this term.InequalityTerm[]
getDependentTerms()
Return the array of dependent terms contained by this term.java.lang.Object
getValue()
Return the value of this inequality term.InequalityTerm[]
getVariables()
Return the concept variables for this inequality term.void
initialize(java.lang.Object e)
Throw an Exception.boolean
isSettable()
Return false.boolean
isValueAcceptable()
Return true.void
setValue(java.lang.Object e)
Throw an Exception.java.lang.String
toString()
Override the base class to give a description of this term.
-
-
-
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 interfaceInequalityTerm
- 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 interfaceInequalityTerm
- 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 interfaceInequalityTerm
- 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 interfaceInequalityTerm
- 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 interfaceInequalityTerm
- Returns:
- False.
-
isValueAcceptable
public boolean isValueAcceptable()
Return true. Function terms are, by default, always acceptable.- Specified by:
isValueAcceptable
in interfaceInequalityTerm
- 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 interfaceInequalityTerm
- 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 classjava.lang.Object
- Returns:
- A description of this term.
-
-