|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.actor.gt.GTIngredient
ptolemy.actor.gt.ingredients.operations.Operation
ptolemy.actor.gt.ingredients.operations.AttributeOperation
public class AttributeOperation
An operation to add or change an attribute.
| Red (tfeng) |
| Yellow (tfeng) |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ptolemy.actor.gt.GTIngredient |
|---|
GTIngredient.FieldIterator |
| Field Summary | |
|---|---|
private java.lang.String |
_attributeClass
Value of the attributeClass element. |
private java.lang.String |
_attributeName
Value of the attributeName element. |
private PtolemyExpressionString |
_attributeValue
Value of the attributeValue element. |
private static OperationElement[] |
_ELEMENTS
The elements. |
private ASTPtRootNode |
_valueParseTree
Parse tree of the attributeValue element. |
| Fields inherited from class ptolemy.actor.gt.ingredients.operations.Operation |
|---|
_parseTreeWriter |
| Fields inherited from class ptolemy.actor.gt.GTIngredient |
|---|
FIELD_SEPARATOR |
| Constructor Summary | |
|---|---|
AttributeOperation(GTIngredientList owner)
Construct an operation within the given list as its owner. |
|
AttributeOperation(GTIngredientList owner,
java.lang.String values)
Construct an operation within the given list as its owner and initialize all the elements with the given values, which are a string encoding of those elements. |
|
AttributeOperation(GTIngredientList owner,
java.lang.String attributeName,
java.lang.String attributeClass,
java.lang.String attributeValue)
Construct an operation within the given list as its owner and with the given value to each of its elements.. |
|
| Method Summary | |
|---|---|
protected void |
_reparse()
Generate the parse tree for the attributeValue element again. |
ChangeRequest |
getChangeRequest(Pattern pattern,
Replacement replacement,
MatchResult matchResult,
NamedObj patternObject,
NamedObj replacementObject,
NamedObj hostObject)
Get the change request to update the object in the host model. |
GTIngredientElement[] |
getElements()
Get the array of elements defined in this GTIngredient. |
java.lang.Object |
getValue(int index)
Get the value of the index-th elements. |
java.lang.String |
getValues()
Get a string that describes the values of all the elements. |
boolean |
isAttributeClassEnabled()
Return whether the attributeClass element is enabled. |
boolean |
isAttributeNameEnabled()
Return whether the attributeName element is enabled. |
boolean |
isAttributeValueEnabled()
Return whether the attributeValue element is enabled. |
void |
setAttributeClass(java.lang.String attributeClass)
Set the value of the attributeClass element. |
void |
setAttributeName(java.lang.String attributeName)
Set the value of the attributeName element. |
void |
setAttributeValue(java.lang.String attributeValue)
Set the value of the attributeValue element. |
void |
setValue(int index,
java.lang.Object value)
Set the value of the index-th element. |
void |
setValues(java.lang.String values)
Set the values of all the elements with a string that describes them. |
void |
validate()
Validate the enablements and values of all the elements. |
| Methods inherited from class ptolemy.actor.gt.ingredients.operations.Operation |
|---|
_evaluate |
| Methods inherited from class ptolemy.actor.gt.GTIngredient |
|---|
_decodeBooleanField, _decodeStringField, _encodeBooleanField, _encodeStringField, _escapeElementString, _findMatchingParen, _findSeparator, _unescapeElementString, disableAll, enableAll, getOwner, isApplicable, isEnabled, setEnabled, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final OperationElement[] _ELEMENTS
private java.lang.String _attributeClass
private java.lang.String _attributeName
private PtolemyExpressionString _attributeValue
private ASTPtRootNode _valueParseTree
| Constructor Detail |
|---|
public AttributeOperation(GTIngredientList owner)
owner - The list as the owner of the constructed GTIngredientList.
public AttributeOperation(GTIngredientList owner,
java.lang.String values)
owner - The list as the owner of the constructed GTIngredientList.values - The string encoding of the values of the elements.
public AttributeOperation(GTIngredientList owner,
java.lang.String attributeName,
java.lang.String attributeClass,
java.lang.String attributeValue)
owner - The list as the owner of the constructed GTIngredientList.attributeName - Value of the attributeName element.attributeClass - Value of the attributeClass element.attributeValue - Value of the attributeValue element.| Method Detail |
|---|
public ChangeRequest getChangeRequest(Pattern pattern,
Replacement replacement,
MatchResult matchResult,
NamedObj patternObject,
NamedObj replacementObject,
NamedObj hostObject)
throws IllegalActionException
getChangeRequest in class Operationpattern - The pattern of the transformation rule.replacement - The replacement of the transformation rule.matchResult - The match result.patternObject - The object in the pattern, or null.replacementObject - The object in the replacement that corresponds
to the object in the pattern.hostObject - The object in the host model corresponding to the
object in the replacement.
IllegalActionException - If error occurs in generating the
change request.public GTIngredientElement[] getElements()
getElements in class GTIngredientpublic java.lang.Object getValue(int index)
getValue in class GTIngredientindex - The index.
setValue(int, Object)public java.lang.String getValues()
getValues in class GTIngredientsetValues(String)public boolean isAttributeClassEnabled()
public boolean isAttributeNameEnabled()
public boolean isAttributeValueEnabled()
public void setAttributeClass(java.lang.String attributeClass)
attributeClass - The value of the attributeClass element.public void setAttributeName(java.lang.String attributeName)
attributeName - The value of the attributeName element.public void setAttributeValue(java.lang.String attributeValue)
attributeValue - The value of the attributeValue element.
public void setValue(int index,
java.lang.Object value)
setValue in class GTIngredientindex - The index.value - The value.getValue(int)public void setValues(java.lang.String values)
setValues in class GTIngredientvalues - A string that describes the new values of all the
elements.getValues()
public void validate()
throws ValidationException
validate in class GTIngredientValidationException - If some elements are invalid.
protected void _reparse()
throws IllegalActionException
IllegalActionException - If error occurs in the parse tree
generation.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||