Package ptolemy.actor.gt.controller
Class PersistenceAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.SingletonAttribute
-
- ptolemy.actor.gt.controller.PersistenceAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Singleton
public class PersistenceAttribute extends SingletonAttribute
A marker attribute indicating that a design pattern should be persistent.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
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 PersistenceAttribute(NamedObj container, java.lang.String name)
Construct an attribute with the given name contained by the specified entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamedObj
clone(Workspace workspace)
Clone the parameter into the specified workspace.boolean
isPersistent()
Always return false, indicating that this attribute is not persistent.void
setContainer(NamedObj container)
Specify the container NamedObj, adding this attribute to the list of attributes in the container.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, 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, attributeChanged, 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, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Constructor Detail
-
PersistenceAttribute
public PersistenceAttribute(NamedObj container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Construct an attribute with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.- Parameters:
container
- The container.name
- The name of this attribute.- 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
-
clone
public NamedObj clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Clone the parameter into the specified workspace. The cloned parameter is marked as being persistent.- Overrides:
clone
in classAttribute
- Parameters:
workspace
- The workspace for the new object.- Returns:
- A new parameter.
- Throws:
java.lang.CloneNotSupportedException
- If a derived class contains an attribute that cannot be cloned.- See Also:
NamedObj.exportMoML(Writer, int, String)
,NamedObj.setDeferringChangeRequests(boolean)
-
isPersistent
public boolean isPersistent()
Always return false, indicating that this attribute is not persistent.- Specified by:
isPersistent
in interfaceMoMLExportable
- Overrides:
isPersistent
in classNamedObj
- Returns:
- Always return false, indicating that this attribute is not persistent.
- See Also:
NamedObj.setPersistent(boolean)
,MoMLExportable
-
setContainer
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Specify the container NamedObj, adding this attribute to the list of attributes in the container. For non-toplevel containers, before setting the container, the persistence of the old container is set to the previous persistence value, the container is set to the new value and the previous persistence value is updated.- Overrides:
setContainer
in classSingletonAttribute
- Parameters:
container
- The container to attach this attribute to.- Throws:
IllegalActionException
- If this attribute is not of the expected class for the container, or it has no name, or the attribute and container are not in the same workspace, or the proposed container would result in recursive containment.NameDuplicationException
- If the container already has an attribute with the name of this attribute.- See Also:
Attribute.getContainer()
-
-