Package ptolemy.data.ontologies.lattice
Class ActorConstraintsDefinitionAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.data.ontologies.lattice.ActorConstraintsDefinitionAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class ActorConstraintsDefinitionAttribute extends Attribute
Attribute that defines the lattice ontology solver constraints for an actor.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Charles Shelton
- Pt.AcceptedRating:
- Red (cshelton)
- Pt.ProposedRating:
- Green (cshelton)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description StringParameter
actorClassName
The string that represents the class name of the actor for which this attribute defines lattice ontology solver constraints.static java.lang.String
ATTR_SUFFIX
The string suffix for attribute names that represent constraint definitions for actor attributes.static java.lang.String
EQ
String representing an equal to constraint choice.StringParameter
foundActorClassName
The parameter that contains the last valid actor class name found.static java.lang.String
GTE
String representing a greater than or equal to constraint choice.static java.lang.String
IGNORE
String representing that the actor port or attribute should be ignored for the ontology analysis and not have a concept assigned to it.static java.lang.String
LTE
String representing a less than or equal to constraint choice.static java.lang.String
NO_CONSTRAINTS
String representing that the actor port or attribute has no constraints but should have a concept assigned to it.static java.lang.String
PORT_SUFFIX
The string suffix for attribute names that represent constraint definitions for actor ports.static java.lang.String
SEPARATOR
String representing the separator character ";" between constraint expressions in the constraint expression string.static int
SUFFIX_LENGTH
The length of the attribute and port suffix strings.-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description ActorConstraintsDefinitionAttribute(CompositeEntity container, java.lang.String name)
Construct the ActorConstraintsDefinitionAttribute attribute with the given container and name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attributeChanged(Attribute attribute)
Override the attributeChanged method so that if the actor class name changes, the attribute interface adds and removes fields for constraints for the actor's ports and attributes.ActorConstraintsDefinitionAdapter
createAdapter(ComponentEntity component, LatticeOntologySolver solver)
Get the adapter defined by this attribute.static java.lang.String
createConstraintParameterName(NamedObj actorElement)
Return a constraint parameter name based on the name of the specified actor element.static java.lang.String
getActorElementName(StringParameter expressionParameter)
Get the name of the element contained by the actor (either a port or an attribute) for which the specified parameter defines a constraint.static java.util.List<java.lang.String>
getConstraintDirAndRHSStrings(java.lang.String constraintExpressionString)
Return the string constraint direction for the given constraint expression specified as a string.static boolean
isActorElementAnAttribute(StringParameter actorElementConstraintExpression)
Return true if the actor element constraint expression is for an attribute, false otherwise.static boolean
isActorElementAPort(StringParameter actorElementConstraintExpression)
Return true if the actor element constraint expression is for a port, false otherwise.static boolean
isActorElementIgnored(StringParameter actorElementConstraintExpression)
Return true if the actor element is set to be ignored by the ontology analysis, false otherwise.static boolean
isActorElementUnconstrained(StringParameter actorElementConstraintExpression)
Return true if the actor element is set to have no constraints for the ontology analysis, false otherwise.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
actorClassName
public StringParameter actorClassName
The string that represents the class name of the actor for which this attribute defines lattice ontology solver constraints.
-
foundActorClassName
public StringParameter foundActorClassName
The parameter that contains the last valid actor class name found.
-
ATTR_SUFFIX
public static final java.lang.String ATTR_SUFFIX
The string suffix for attribute names that represent constraint definitions for actor attributes.- See Also:
- Constant Field Values
-
EQ
public static final java.lang.String EQ
String representing an equal to constraint choice.- See Also:
- Constant Field Values
-
GTE
public static final java.lang.String GTE
String representing a greater than or equal to constraint choice.- See Also:
- Constant Field Values
-
IGNORE
public static final java.lang.String IGNORE
String representing that the actor port or attribute should be ignored for the ontology analysis and not have a concept assigned to it.- See Also:
- Constant Field Values
-
LTE
public static final java.lang.String LTE
String representing a less than or equal to constraint choice.- See Also:
- Constant Field Values
-
NO_CONSTRAINTS
public static final java.lang.String NO_CONSTRAINTS
String representing that the actor port or attribute has no constraints but should have a concept assigned to it.- See Also:
- Constant Field Values
-
PORT_SUFFIX
public static final java.lang.String PORT_SUFFIX
The string suffix for attribute names that represent constraint definitions for actor ports.- See Also:
- Constant Field Values
-
SEPARATOR
public static final java.lang.String SEPARATOR
String representing the separator character ";" between constraint expressions in the constraint expression string.- See Also:
- Constant Field Values
-
SUFFIX_LENGTH
public static final int SUFFIX_LENGTH
The length of the attribute and port suffix strings.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ActorConstraintsDefinitionAttribute
public ActorConstraintsDefinitionAttribute(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct the ActorConstraintsDefinitionAttribute attribute with the given container and name.- Parameters:
container
- The container.name
- The name of this attribute.- Throws:
IllegalActionException
- If the entity cannot be contained by the proposed container.NameDuplicationException
- If the container already has an actor with this name.
-
-
Method Detail
-
attributeChanged
public void attributeChanged(Attribute attribute) throws IllegalActionException
Override the attributeChanged method so that if the actor class name changes, the attribute interface adds and removes fields for constraints for the actor's ports and attributes.- Overrides:
attributeChanged
in classNamedObj
- Parameters:
attribute
- The attribute that has been changed.- Throws:
IllegalActionException
- If there is a problem changing the attribute.
-
createAdapter
public ActorConstraintsDefinitionAdapter createAdapter(ComponentEntity component, LatticeOntologySolver solver) throws IllegalActionException
Get the adapter defined by this attribute.- Parameters:
component
- The model component for which the adapter will be created.solver
- The lattice ontology solver for which this adapter is being created.- Returns:
- The ActorConstraintsDefinitionAdapter specified by this attribute.
- Throws:
IllegalActionException
- If the container model's solver cannot be found or there is a problem initializing the adapter.
-
createConstraintParameterName
public static java.lang.String createConstraintParameterName(NamedObj actorElement)
Return a constraint parameter name based on the name of the specified actor element. This method supports ports and attributes.- Parameters:
actorElement
- The actor element for which to generate a constraint parameter name.- Returns:
- The string name for the constraint parameter for this actor element.
-
getActorElementName
public static java.lang.String getActorElementName(StringParameter expressionParameter) throws IllegalActionException
Get the name of the element contained by the actor (either a port or an attribute) for which the specified parameter defines a constraint.- Parameters:
expressionParameter
- The string parameter that defines the element's constraints.- Returns:
- The string name of the element (either a port or an attribute).
- Throws:
IllegalActionException
- If the expressionParameter passed in is null.
-
getConstraintDirAndRHSStrings
public static java.util.List<java.lang.String> getConstraintDirAndRHSStrings(java.lang.String constraintExpressionString)
Return the string constraint direction for the given constraint expression specified as a string.- Parameters:
constraintExpressionString
- The string that specifies a single constraint expression for an actor element.- Returns:
- The string '≤', '≥', or '==' depending on the specified constraint direction, false otherwise.
-
isActorElementAnAttribute
public static boolean isActorElementAnAttribute(StringParameter actorElementConstraintExpression) throws IllegalActionException
Return true if the actor element constraint expression is for an attribute, false otherwise.- Parameters:
actorElementConstraintExpression
- The constraint expression for the actor element.- Returns:
- true if the actor element constraint expression is for an attribute, false otherwise.
- Throws:
IllegalActionException
- If the constrain expression parameter is null.
-
isActorElementAPort
public static boolean isActorElementAPort(StringParameter actorElementConstraintExpression) throws IllegalActionException
Return true if the actor element constraint expression is for a port, false otherwise.- Parameters:
actorElementConstraintExpression
- The constraint expression for the actor element.- Returns:
- true if the actor element constraint expression is for a port, false otherwise.
- Throws:
IllegalActionException
- If the constrain expression parameter is null.
-
isActorElementIgnored
public static boolean isActorElementIgnored(StringParameter actorElementConstraintExpression) throws IllegalActionException
Return true if the actor element is set to be ignored by the ontology analysis, false otherwise.- Parameters:
actorElementConstraintExpression
- The constraint expression for the actor element.- Returns:
- true if the actor element is set to be ignored by the ontology analysis, false otherwise.
- Throws:
IllegalActionException
- If the constrain expression parameter is null.
-
isActorElementUnconstrained
public static boolean isActorElementUnconstrained(StringParameter actorElementConstraintExpression) throws IllegalActionException
Return true if the actor element is set to have no constraints for the ontology analysis, false otherwise.- Parameters:
actorElementConstraintExpression
- The constraint expression for the actor element.- Returns:
- true if the actor element is set to have no constraints for the ontology analysis, false otherwise.
- Throws:
IllegalActionException
- If the constrain expression parameter is null.
-
-