|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.DIFAttribute
public class DIFAttribute
Attribute class for DIF graphs.
DIFAttribute is contained by AttributeContainer
.
Each element (mocgraph.Node or mocgraph.Edge) in a DIFGraph
associates with an AttributeContainer
containing all attributes
(DIFAttribute) of that element.
A value of a DIFAttribute can be either an instance of graph element
(reference type) or value object. The refenence type can be
an instance of Port
, Edge, Node, or
DIFParameter
, or a LinkedList of those graph objects.
The value object of an DIFAttribute can be one of the following classes:
Integer, Double, Complex, String, Boolean, int[], double[],
Complex[], int[][], double[][], Complex[][], ArrayList.
setDataType(java.lang.String)
and getDataType()
can be used to specify and
get the datatype information of the value object.
A DIFAttribute can have a type. A type of a DIFAttribute is the class identifier of the object represented by that DIFAttribute. In some cases, attributes of the same actor can have the same name but different types, the type of DIFAttribute is used to distinguish between them. For example, a Ptolemy actor may have a parameter called "input" and have a IOPort called "input".
DIFGraph
Constructor Summary | |
---|---|
protected |
DIFAttribute()
Empty default constructor. |
|
DIFAttribute(java.lang.String name)
Constructor. |
Method Summary | |
---|---|
protected java.lang.Object |
_cloneValue(java.lang.Object map)
Clone token value. |
protected void |
_setContainer(AttributeContainer container)
AttributeContainer.setAttribute(mapss.dif.DIFAttribute) will set the back
reference. |
java.lang.Object |
clone()
Return the cloned version of DIFAttribute with the same name, same type, and same value. |
java.lang.Object |
clone(java.lang.Object map)
Return the cloned version of DIFAttribute with the same name, the same type, the same value, and the reference of Node, Edge, or DIFParameter object, or the deep clone of LinkedList. |
boolean |
equals(java.lang.Object object)
Compare the DIFAttribute object with the input object. |
AttributeContainer |
getContainer()
Get container. |
java.lang.String |
getDataType()
Get datatype of the value of attribute. |
java.lang.String |
getName()
Get attribute name. |
java.lang.String |
getType()
Get attribute type. |
java.lang.Object |
getValue()
Get attribute value. |
int |
hashCode()
|
void |
setDataType(java.lang.String datatype)
Set the datatype of the value of attribute. |
void |
setType(java.lang.String type)
Set the type of attribute. |
java.lang.Object |
setValue(java.lang.Object value)
Set attribute value. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DIFAttribute()
public DIFAttribute(java.lang.String name)
name
- The attribute name.
java.lang.IllegalArgumentException
- If
Conventions.labelConvention(java.lang.String)
returns an error
for the parameter name.Method Detail |
---|
public java.lang.Object clone()
AttributeContainer
, ie, _container, instead,
it is null in the cloned version.
AttributeContainer.clone()
will handle this backward reference.
clone
in class java.lang.Object
public java.lang.Object clone(java.lang.Object map)
AttributeContainer
, ie, _container, instead,
it is null in the cloned version.
AttributeContainer.clone(Object)
will handle this backward reference.
map
- The Map that contains the mapping
from the original reference value to the mirrored reference
value.
_cloneValue(Object)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The DIFAttribute instance.
public AttributeContainer getContainer()
public java.lang.String getDataType()
public java.lang.String getName()
public java.lang.String getType()
public java.lang.Object getValue()
setValue(Object)
public int hashCode()
hashCode
in class java.lang.Object
public void setDataType(java.lang.String datatype)
datatype
- public void setType(java.lang.String type)
type
- public java.lang.Object setValue(java.lang.Object value)
value
- A value object. The current DIF Language supports
are Integer, Double, Complex, String, Boolean, int[], double[],
Complex[], int[][], double[][], Complex[][], ArrayList,
or an object of
Port/Edge/Node/DIFParameter, or a LinkedList of objects.
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.Object _cloneValue(java.lang.Object map)
map
- The HashMap object.clone(Object)
protected void _setContainer(AttributeContainer container)
AttributeContainer.setAttribute(mapss.dif.DIFAttribute)
will set the back
reference.
container
- The AttributeContainer
containes this
DIFAttribute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |