public class GeneratorAttribute extends SingletonAttribute implements ChangeListener
The initial default parameters, their values and their documentation are read in from a MoML file specified by the initialParametersURL. Having the parameters defined in a MoML file allows us to easily add and modify parameters without lots of bookkeeping.
To view the initial default parameters, either call toString(), or run:
java -classpath $PTII ptolemy.copernicus.kernel.Copernicus -help
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
StringParameter |
initialParametersURL
MoML file that contains other parameters.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
GeneratorAttribute(NamedObj container,
java.lang.String name)
Construct an attribute with the given name contained by the specified
entity.
|
Modifier and Type | Method and Description |
---|---|
void |
changeExecuted(ChangeRequest change)
React to a change request has been successfully executed.
|
void |
changeFailed(ChangeRequest change,
java.lang.Exception exception)
React to a change request has resulted in an exception.
|
java.lang.String |
getParameter(java.lang.String name)
Get the string for the argument with the given name from this
GeneratorAttribute.
|
boolean |
hasParameter(java.lang.String name)
Return true if a parameter with the given name is defined in this
GeneratorAttribute.
|
void |
initialize()
If this GeneratorAttribute has not yet been initialized, the
initialized it by reading the moml file named by the
initialParametersURL and creating Parameters and Variables
accordingly.
|
static java.lang.String |
lookupClassAsResource(java.lang.String necessaryClass)
Deprecated.
Call ptolemy.util.ClassUtilities.lookupClassAsResource()
instead;
|
void |
sanityCheckAndUpdateParameters(java.lang.String modelPathOrURL) |
void |
setParameter(java.lang.String name,
java.lang.String value)
Set the string for the argument with the given name from this
GeneratorAttribute to be the given value.
|
java.lang.String |
toString()
Return a String representation of this object.
|
void |
updateModelAttributes(java.lang.String modelPathOrURL)
Update the modelPath, modelName and iterations parameters in
the GeneratorAttribute.
|
setContainer
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_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, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
public StringParameter initialParametersURL
public GeneratorAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this attribute.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.public void changeExecuted(ChangeRequest change)
ChangeListener
changeExecuted
in interface ChangeListener
change
- The change that has been executed, or null if
the change was not done via a ChangeRequest.public void changeFailed(ChangeRequest change, java.lang.Exception exception)
ChangeListener
changeFailed
in interface ChangeListener
change
- The change that was attempted or null if
the change was not done via a ChangeRequest.exception
- The exception that resulted.public java.lang.String getParameter(java.lang.String name) throws IllegalActionException
IllegalActionException
- If no Settable object with
the given name exists in this GeneratorAttribute.public boolean hasParameter(java.lang.String name) throws IllegalActionException
IllegalActionException
public void initialize() throws IllegalActionException, NameDuplicationException
@Deprecated public static java.lang.String lookupClassAsResource(java.lang.String necessaryClass)
necessaryClass
- The dot separated class name, for example
"ptolemy.kernel.util.NamedObj"public void sanityCheckAndUpdateParameters(java.lang.String modelPathOrURL) throws IllegalActionException, NameDuplicationException
public void setParameter(java.lang.String name, java.lang.String value) throws IllegalActionException
IllegalActionException
- If no Settable object with
the given name exists in this GeneratorAttribute.public java.lang.String toString()
public void updateModelAttributes(java.lang.String modelPathOrURL) throws IllegalActionException
modelPathOrURL
- The file pathname or URL to the model.IllegalActionException