Package ptolemy.data.ontologies
Class ConceptAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.AbstractSettableAttribute
-
- ptolemy.data.ontologies.ConceptAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
public class ConceptAttribute extends AbstractSettableAttribute
The base class of a concept attribute. A ConceptAttribute contains the concept value annotated by the solver.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Man-Kit Leung
- Pt.AcceptedRating:
- Red (mankit)
- Pt.ProposedRating:
- Red (mankit)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
Field Summary
Fields Modifier and Type Field Description protected Concept
_concept
The Concept contained by the ConceptAttribute.-
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
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Constructor Summary
Constructors Constructor Description ConceptAttribute(NamedObj container, java.lang.String name)
Construct a ConceptAttribute with the specified name and container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValueListener(ValueListener listener)
Add the specified ValueListener.void
exportMoML(java.io.Writer output, int depth, java.lang.String name)
Write a MoML description of the ConceptAttribute.Concept
getConcept()
Returns the Concept value.java.lang.String
getExpression()
Get the string name of the Concept contained by the ConceptAttribute or the empty string if there is none.Settable.Visibility
getVisibility()
Get the visibility of this Settable, as set by setVisibility().void
removeValueListener(ValueListener listener)
Remove the specified ValueListener.void
setConcept(Concept concept)
Specifies the Concept value.void
setVisibility(Settable.Visibility visibility)
Set the visibility of this Settable.java.util.Collection<?>
validate()
The validate() method must be implemented to implement the Settable interface but is not relevant for the ConceptAttribute class.-
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute
getDefaultExpression, getValueAsString, setExpression
-
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, _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, 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, toString, uniqueName, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
-
Methods inherited from interface ptolemy.kernel.util.Settable
getDisplayName
-
-
-
-
Field Detail
-
_concept
protected Concept _concept
The Concept contained by the ConceptAttribute.
-
-
Constructor Detail
-
ConceptAttribute
public ConceptAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a ConceptAttribute with the specified name and container.- Parameters:
container
- The specified container.name
- The specified name.- 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
-
addValueListener
public void addValueListener(ValueListener listener)
Add the specified ValueListener. Currently this class doesn't support any listeners, so this method does nothing.- Parameters:
listener
- The listener to add.- See Also:
removeValueListener(ptolemy.kernel.util.ValueListener)
-
exportMoML
public void exportMoML(java.io.Writer output, int depth, java.lang.String name) throws java.io.IOException
Write a MoML description of the ConceptAttribute. Nothing is written if the value is null or "".- Specified by:
exportMoML
in interfaceMoMLExportable
- Overrides:
exportMoML
in classNamedObj
- Parameters:
output
- The output stream to write to.depth
- The depth in the hierarchy, to determine indenting.name
- The name to use instead of the current name.- Throws:
java.io.IOException
- If an I/O error occurs.- See Also:
NamedObj.exportMoML(Writer, int, String)
-
getExpression
public java.lang.String getExpression()
Get the string name of the Concept contained by the ConceptAttribute or the empty string if there is none.- Returns:
- The name of the Concept as a string, or the empty string "".
- See Also:
Settable.setExpression(String)
-
getConcept
public Concept getConcept()
Returns the Concept value.- Returns:
- a Concept object representing the Concept value contained by the ConceptAttribute.
- See Also:
setConcept(ptolemy.data.ontologies.Concept)
-
getVisibility
public Settable.Visibility getVisibility()
Get the visibility of this Settable, as set by setVisibility(). If setVisibility() has not been called, then this method returns the default Settable.FULL. The returned value is one of the static instances of the Visibility inner class.- Returns:
- The visibility of this Settable.
- See Also:
setVisibility(Settable.Visibility)
-
removeValueListener
public void removeValueListener(ValueListener listener)
Remove the specified ValueListener. Currently this class doesn't support any listeners, so this method does nothing.- Parameters:
listener
- The listener to remove.- See Also:
addValueListener(ptolemy.kernel.util.ValueListener)
-
setConcept
public void setConcept(Concept concept)
Specifies the Concept value.- Parameters:
concept
- a Concept object specifying the Concept value contained by the ConceptAttribute.- See Also:
getConcept()
-
setVisibility
public void setVisibility(Settable.Visibility visibility)
Set the visibility of this Settable. The argument should be one of the static public instances of the inner class Visibility. This is enforced by making it impossible to construct instances of this inner class outside this interface definition.- Parameters:
visibility
- The visibility of this Settable.- See Also:
getVisibility()
-
validate
public java.util.Collection<?> validate() throws IllegalActionException
The validate() method must be implemented to implement the Settable interface but is not relevant for the ConceptAttribute class.- Returns:
- null
- Throws:
IllegalActionException
- To match the signature of the validate() method in the Settable interface, but this is not ever thrown here.
-
-