ptolemy.kernel.attributes
Class IDAttribute

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.util.Attribute
          extended byptolemy.kernel.util.SingletonAttribute
              extended byptolemy.kernel.attributes.IDAttribute
All Implemented Interfaces:
Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, Singleton

public class IDAttribute
extends SingletonAttribute

This attribute identifies the containing model, showing its name, base class, last modified date, and author information. Of these, only the author information is editable. For the others, they are inferred from the model. Unfortunately, if they change, the display will not be updated, however, until the model is re-opened.

Since:
Ptolemy II 4.0
Version:
$Id: IDAttribute.java,v 1.14.2.1 2004/06/18 00:49:17 cxh Exp $
Author:
Edward A. Lee
See Also:
Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Yellow (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 StringAttribute author
          The author of the class.
 StringAttribute baseClass
          The base class of the containing class or entity.
 StringAttribute isClass
          A boolean indicating whether the container is a class or an instance.
 StringAttribute lastUpdated
          The date that this model was last updated.
 StringAttribute name
          The name of the containing class or entity.
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
IDAttribute(Entity container, java.lang.String name)
          Construct an attribute with the given name contained by the specified container.
 
Method Summary
 void attributeChanged(Attribute attribute)
          React to a change in an attribute.
 void setDate(java.util.Date date)
          Set the date for the lastUpdated parameter.
 
Methods inherited from class ptolemy.kernel.util.SingletonAttribute
setContainer
 
Methods inherited from class ptolemy.kernel.util.Attribute
_getContainedObject, _propagateExistence, clone, getContainer, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

author

public StringAttribute author
The author of the class.


baseClass

public StringAttribute baseClass
The base class of the containing class or entity.


isClass

public StringAttribute isClass
A boolean indicating whether the container is a class or an instance. This is a string that must have value "true" or "false".


lastUpdated

public StringAttribute lastUpdated
The date that this model was last updated.


name

public StringAttribute name
The name of the containing class or entity.

Constructor Detail

IDAttribute

public IDAttribute(Entity container,
                   java.lang.String name)
            throws IllegalActionException,
                   NameDuplicationException
Construct an attribute with the given name contained by the specified container. 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

attributeChanged

public void attributeChanged(Attribute attribute)
                      throws IllegalActionException
React to a change in an attribute. If the attribute is name, then change the name of the container to match.

Overrides:
attributeChanged in class NamedObj
Parameters:
attribute - The attribute that changed.
Throws:
IllegalActionException - If the change is not acceptable to this container (not thrown in this base class).

setDate

public void setDate(java.util.Date date)
Set the date for the lastUpdated parameter. A null argument requests that the date be set to now.

Parameters:
date - The date to set.