Package ptolemy.kernel.util.test
Class TestNullNamedObj
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.test.TestNullNamedObj
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class TestNullNamedObj extends NamedObj
TestNullNamedObj is like NamedObj, except that null names are permissible. This class is used to test some of the assertions in classes such as NamedList.- Since:
- Ptolemy II 0.3
- Version:
- $Id$
- Author:
- Christopher Hylands
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Green (cxh)
-
-
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 TestNullNamedObj()
Construct an object in the default workspace with an empty string as its name.TestNullNamedObj(java.lang.String name)
Construct an object in the default workspace with an empty string as its name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamedObj
getContainedObject(NamedObj container, java.lang.String relativeName)
Get an object with the specified name in the specified container.java.lang.String
getName()
Get the name.void
setName(java.lang.String name)
Set or change the name.-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateExistence, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Constructor Detail
-
TestNullNamedObj
public TestNullNamedObj() throws IllegalActionException
Construct an object in the default workspace with an empty string as its name. The object is added to the list of objects in the workspace. Increment the version number of the workspace.- Throws:
IllegalActionException
- Not thrown.
-
TestNullNamedObj
public TestNullNamedObj(java.lang.String name) throws IllegalActionException
Construct an object in the default workspace with an empty string as its name. The object is added to the list of objects in the workspace. Increment the version number of the workspace.- Throws:
IllegalActionException
- If the name has a period.
-
-
Method Detail
-
getContainedObject
public NamedObj getContainedObject(NamedObj container, java.lang.String relativeName) throws IllegalActionException
Get an object with the specified name in the specified container. The type of object sought is an instance of the same class as this object. In this base class, return null, as there is no containment mechanism. Derived classes should override this method to return an object of their same type.- Parameters:
relativeName
- The name relative to the container.container
- The container expected to contain the object.- Returns:
- null.
- Throws:
IllegalActionException
- If the object exists and has the wrong class. Not thrown in this base class.
-
getName
public java.lang.String getName()
Get the name. If no name has been given, or null has been given, then return an empty string, "".- Specified by:
getName
in interfaceNameable
- Overrides:
getName
in classNamedObj
- Returns:
- The name of the object.
- See Also:
NamedObj.setName(String)
-
setName
public void setName(java.lang.String name) throws NameDuplicationException
Set or change the name. If a null argument is given the name is set to an empty string. Increment the version of the workspace. This method is write-synchronized on the workspace.- Specified by:
setName
in interfaceNameable
- Overrides:
setName
in classNamedObj
- Parameters:
name
- The new name.- Throws:
NameDuplicationException
- Not thrown in this base class. May be thrown by derived classes if the container already contains an object with this name.- See Also:
NamedObj.getName()
,NamedObj.getName(NamedObj)
-
-