Package ptolemy.data.ontologies.lattice
Class ConceptTermManager.InequalityTerm
- java.lang.Object
-
- ptolemy.data.ontologies.lattice.ConceptTermManager.InequalityTerm
-
- All Implemented Interfaces:
InequalityTerm
- Enclosing class:
- ConceptTermManager
public class ConceptTermManager.InequalityTerm extends java.lang.Object implements InequalityTerm
An InequalityTerm class that is used for ontology analysis and contains a reference to the associated object for the InequalityTerm.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
_object
The model object associated with the InequalityTerm.
-
Constructor Summary
Constructors Modifier Constructor Description protected
InequalityTerm(java.lang.Object object)
Construct an InequalityTerm for the given model object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAssociatedObject()
Return the model object associated with the InequalityTerm.ConceptTermManager.InequalityTerm[]
getConstants()
Return an array of one element with this InequalityTerm if it is a constant InequalityTerm that cannot be changed.java.lang.Object
getValue()
Return null if this term is not effective.ConceptTermManager.InequalityTerm[]
getVariables()
Return this ptolemy.graph.InequalityTerm in an array if this term represent a property variable.void
initialize(java.lang.Object property)
Reset the variable part of this type to the specified type.boolean
isEffective()
Return true if the InequalityTerm is an effective constraint for the OntologySolver, and false otherwise.boolean
isSettable()
Test if the property of the port associated with this Term can be changed.boolean
isValueAcceptable()
Check whether the current value of this term is acceptable.void
setEffective(boolean isEffective)
Sets whether the InequalityTerm constraint will be effective for the OntologySolver's algorithm.void
setValue(java.lang.Object property)
Set the property value of this term.java.lang.String
toString()
Override the base class to give a description of the port and its property.
-
-
-
Method Detail
-
getAssociatedObject
public java.lang.Object getAssociatedObject()
Return the model object associated with the InequalityTerm.- Specified by:
getAssociatedObject
in interfaceInequalityTerm
- Returns:
- The associated model object
-
getValue
public java.lang.Object getValue()
Return null if this term is not effective. Otherwise, return the resolved property of this ptolemy.graph.InequalityTerm.- Specified by:
getValue
in interfaceInequalityTerm
- Returns:
- The resolved Concept of this InequalityTerm, or null if this term is not effective
- See Also:
setValue(Object)
-
getVariables
public ConceptTermManager.InequalityTerm[] getVariables()
Return this ptolemy.graph.InequalityTerm in an array if this term represent a property variable. This term represents a property variable if the property of this port is not set through setEquals(). If the property of this port is set, return an array of size zero.- Specified by:
getVariables
in interfaceInequalityTerm
- Returns:
- An array of InequalityTerm.
-
getConstants
public ConceptTermManager.InequalityTerm[] getConstants()
Return an array of one element with this InequalityTerm if it is a constant InequalityTerm that cannot be changed. If it can be changed then return an empty InequalityTerm array.- Returns:
- The InequalityTerm array with either one or zero elements that is returned.
-
initialize
public void initialize(java.lang.Object property) throws IllegalActionException
Reset the variable part of this type to the specified type.- Specified by:
initialize
in interfaceInequalityTerm
- Parameters:
property
- A Type.- Throws:
IllegalActionException
- If the type is not settable, or the argument is not a Type.
-
isEffective
public boolean isEffective()
Return true if the InequalityTerm is an effective constraint for the OntologySolver, and false otherwise. Effective means the constraint will be used by the OntologySolver when it runs its algorithm. If it is not effective, the constraint will not be used by the OntologySolver.- Returns:
- true if the InequalityTerm is effective, false otherwise
-
isSettable
public boolean isSettable()
Test if the property of the port associated with this Term can be changed. The property can be changed if setEquals() is not called.- Specified by:
isSettable
in interfaceInequalityTerm
- Returns:
- True if the property can be changed; false otherwise.
-
isValueAcceptable
public boolean isValueAcceptable()
Check whether the current value of this term is acceptable. This method delegates the check to the isTypeAcceptable() method of the outer class.- Specified by:
isValueAcceptable
in interfaceInequalityTerm
- Returns:
- True if the current value is acceptable.
-
setEffective
public void setEffective(boolean isEffective)
Sets whether the InequalityTerm constraint will be effective for the OntologySolver's algorithm.- Parameters:
isEffective
- true if the InequalityTerm should be effective, false if it should be ineffective- See Also:
isEffective()
-
setValue
public void setValue(java.lang.Object property) throws IllegalActionException
Set the property value of this term.- Specified by:
setValue
in interfaceInequalityTerm
- Parameters:
property
- The given property.- Throws:
IllegalActionException
- If the new type violates the declared property of this port.- See Also:
getValue()
-
toString
public java.lang.String toString()
Override the base class to give a description of the port and its property.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A description of the port and its property.
-
-