ptolemy.actor.gt
Class TransformationMode.WorkingCopyScopeExtender

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.actor.gt.TransformationMode.WorkingCopyScopeExtender
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ScopeExtender, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Enclosing class:
TransformationMode

private static class TransformationMode.WorkingCopyScopeExtender
extends Attribute
implements ScopeExtender

A scope extender to resolve names in the scope of the master transformation rule even though the expression is specified in a working copy.

Since:
Ptolemy II 8.0
Version:
$Id: TransformationMode.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  TransformationRule _masterRule
          The master transformation rule.
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
TransformationMode.WorkingCopyScopeExtender(NamedObj container, java.lang.String name, TransformationRule masterRule)
          Construct a scope extender.
 
Method Summary
 java.util.List<?> attributeList()
          Return a list of the attributes contained by this object.
 Attribute getAttribute(java.lang.String name)
          Get the attribute with the given name.
 
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, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_masterRule

private TransformationRule _masterRule
The master transformation rule.

Constructor Detail

TransformationMode.WorkingCopyScopeExtender

TransformationMode.WorkingCopyScopeExtender(NamedObj container,
                                            java.lang.String name,
                                            TransformationRule masterRule)
                                      throws IllegalActionException,
                                             NameDuplicationException
Construct a scope extender.

Parameters:
container - The container.
name - The name.
masterRule - The master transformation rule.
Throws:
IllegalActionException - If the attribute is not of an acceptable class for the container, or if the name contains a period.
NameDuplicationException - If the name coincides with an attribute already in the container.
Method Detail

attributeList

public java.util.List<?> attributeList()
Return a list of the attributes contained by this object. If there are no attributes, return an empty list. This method is read-synchronized on the workspace.

Specified by:
attributeList in interface ScopeExtender
Overrides:
attributeList in class NamedObj
Returns:
An unmodifiable list of instances of Attribute.

getAttribute

public Attribute getAttribute(java.lang.String name)
Get the attribute with the given name. The name may be compound, with fields separated by periods, in which case the attribute returned is contained by a (deeply) contained attribute.

Specified by:
getAttribute in interface ScopeExtender
Overrides:
getAttribute in class NamedObj
Parameters:
name - The name of the desired attribute.
Returns:
The requested attribute if it is found, null otherwise.