Package ptolemy.graph
Interface InequalityTerm
-
- All Known Implementing Classes:
ArrayElementTypeFunction
,ArrayOfTypesFunction
,BaseDimensionRepresentativeConcept
,BaseUnitConcept
,Concept
,ConceptFunctionInequalityTerm
,ConceptTermManager.InequalityTerm
,ConstructAssociativeType
,DerivedDimensionRepresentativeConcept
,DerivedUnitConcept
,DimensionlessConcept
,DimensionRepresentativeConcept
,ExtractFieldType
,FiniteConcept
,FlatScalarTokenInfiniteConcept
,FlatScalarTokenRepresentativeConcept
,FlatTokenInfiniteConcept
,FlatTokenRepresentativeConcept
,GLBFunction
,InfiniteConcept
,InfiniteConceptRepresentative
,MapTypeInfiniteConcept
,MonotonicFunction
,MonotonicityConcept
,ProductLatticeConcept
,RecordConcept
,SIBaseDimensionRepresentativeConcept
,SIDerivedDimensionRepresentativeConcept
,TestConstant
,TestVariable
,TypeConstant
,UnitConcept
public interface InequalityTerm
An interface for a term in an inequality over a CPO. A term is either a constant, a variable, or a function. In some applications, a term may be associated with an Object. For example, the value of the term may represent a certain characteristic of an Object, and it is necessary to get a reference of that Object from a term. This can be done through the getAssociatedObject() method of this interface.- Since:
- Ptolemy II 0.2
- Version:
- $Id$
- Author:
- Yuhong Xiong
- See Also:
CPO
- Pt.AcceptedRating:
- Green (kienhuis)
- Pt.ProposedRating:
- Green (yuhong)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getAssociatedObject()
Return the Object associated with this term.java.lang.Object
getValue()
Return the value of this term.InequalityTerm[]
getVariables()
Return an array of variables contained in this term.void
initialize(java.lang.Object e)
Initialize the value of this term to the specified CPO element.boolean
isSettable()
Check whether this term can be set to a specific element of the underlying CPO.boolean
isValueAcceptable()
Check whether the current value of this term is acceptable, and return true if it is.void
setValue(java.lang.Object e)
Set the value of this term to the specified CPO element.
-
-
-
Method Detail
-
getAssociatedObject
java.lang.Object getAssociatedObject()
Return the Object associated with this term. If this term is not associated with a particular Object, or it is not necessary to obtain the reference of the associated Object, this method can returnnull
.- Returns:
- The associated Object.
-
getValue
java.lang.Object getValue() throws IllegalActionException
Return the value of this term. If this term is a constant, return that constant; if this term is a variable, return the current value of that variable; if this term is a function, return the evaluation of that function based on the current value of variables in the function.- 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
InequalityTerm[] getVariables()
Return an array of variables contained in this term. If this term is a constant, return an array of size zero; if this term is a variable, return an array of size one that contains this variable; if this term is a function, return an array containing all the variables in the function.- Returns:
- An array of InequalityTerms
-
initialize
void initialize(java.lang.Object e) throws IllegalActionException
Initialize the value of this term to the specified CPO element. If this InequalityTerm is a simple variable that can be set to any CPO element, set the value of the variable to the specified argument. In this case, this method is equivalent tosetValue()
with the same argument. In some applications, this term is a structured object that only part of it is a simple variable. In this case, set that variable part to the specified argument.- Parameters:
e
- An Object representing an element in the underlying CPO.- Throws:
IllegalActionException
- If this term is not a variable.
-
isSettable
boolean isSettable()
Check whether this term can be set to a specific element of the underlying CPO. Only variable terms are settable, constant and function terms are not.- Returns:
- True if this term is a variable; false otherwise.
-
isValueAcceptable
boolean isValueAcceptable()
Check whether the current value of this term is acceptable, and return true if it is.- Returns:
- True if the current value is acceptable.
-
setValue
void setValue(java.lang.Object e) throws IllegalActionException
Set the value of this term to the specified CPO element. Only terms consisting of a single variable can have their values set.- Parameters:
e
- An Object representing an element in the underlying CPO.- Throws:
IllegalActionException
- If this term is not a variable.- See Also:
getValue()
-
-