|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.AttributeContainer
public class AttributeContainer
Container class for attributes used in DIFGraph.
This class contains the implementation details of how attributes
are handled in DIFGraph. For each mocgraph.Edge, mocgraph.Node,
or DIFGraph
object, there is an associated AttributeContainer
containing all the attributes of that object. Also there are setName(java.lang.String)
and getName()
methods of the AttributeContainer which is for storing
the name of the object (Edge/Node) in a graph.
Each DIFAttribute is recognized by its name.
The AttributeContainer utilizes LinkedHashMap to store DIFAttributes. To retrive a DIFAttribute, using DIFAttribute.getName() as key. (Note that it is updated from using both name and type as a key to just name. In general, every actor attribute should have a unique name, and type is just used as supplementary information. However, in this case, an actor having multiple attributes with same name and different types is not supported.) To get the list of DIFAttributes, the "linked" property can maintain the order of insertion.
DIFGraph
,
DIFAttribute
Constructor Summary | |
---|---|
AttributeContainer()
|
|
AttributeContainer(java.lang.String name)
|
Method Summary | |
---|---|
protected void |
_setContainer(java.lang.Object container)
|
java.lang.Object |
clone()
Clone the AttributeContainer and return the cloned version. |
java.lang.Object |
clone(java.lang.Object map)
Clone the AttributeContainer and return the cloned version basedon map that contains the mapping from the original reference value to the cloned reference value. |
boolean |
equals(java.lang.Object container)
Test if an attribute container is equal to this one. |
DIFAttribute |
getAttribute(java.lang.String name)
Returns the DIFAttribute in this container with the given name. |
DIFAttribute |
getAttributeByContent(java.lang.Object value)
Returns the first DIFAttribute with the same value, ie, getValue() == value. |
java.util.LinkedList |
getAttributeNames()
Returns a LinkedList of the names of all DIFAttributes in this container. |
java.util.LinkedList |
getAttributes()
Returns the LinkedList of DIFAttributes in this container. |
java.util.LinkedList |
getAttributesByContent(java.lang.Object value)
Returns the DIFAttributes in this container with the same value, ie, getValue() == value. |
java.lang.Object |
getContainer()
Returns the object contains this AttributeContainer. |
java.lang.String |
getName()
Returns the name of this container set by setName
method. |
int |
hashCode()
Returns the hash code for this object. |
void |
removeAllAttributes()
Reset this attribute container. |
DIFAttribute |
removeAttribute(DIFAttribute attribute)
Removes the DIFAttribute from the container. |
DIFAttribute |
removeAttribute(java.lang.String name)
Removes the DIFAttribute with the given name. |
DIFAttribute |
setAttribute(DIFAttribute attribute)
Set the attribute with the given name and DIFAttribute. |
java.lang.String |
setName(java.lang.String name)
Sets the name of this container. |
java.lang.String |
toString()
Returns the description of this attribute container. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AttributeContainer()
public AttributeContainer(java.lang.String name)
Method Detail |
---|
public java.lang.Object clone()
DIFAttribute.clone()
clone
in class java.lang.Object
public java.lang.Object clone(java.lang.Object map)
DIFAttribute.clone(Object)
. The cloned version of
object that contains this AttributeContainer should call
_setContainer of this class.
map
- The HashMap that contains the mapping
from the original reference value to the cloned reference value.
DIFAttribute
public boolean equals(java.lang.Object container)
equals
in class java.lang.Object
container
- The attribute container with which to compare this
container.
public DIFAttribute getAttribute(java.lang.String name)
name
- Name of the attribute.
public DIFAttribute getAttributeByContent(java.lang.Object value)
value
- The value object.
public java.util.LinkedList getAttributesByContent(java.lang.Object value)
value
- The value object.
public java.util.LinkedList getAttributes()
public java.util.LinkedList getAttributeNames()
public java.lang.Object getContainer()
public java.lang.String getName()
setName
method.
public int hashCode()
hashCode
in class java.lang.Object
public DIFAttribute removeAttribute(java.lang.String name)
name
- Name of the attribute.
public DIFAttribute removeAttribute(DIFAttribute attribute)
attribute
- The DIFAttribute object.
public void removeAllAttributes()
public DIFAttribute setAttribute(DIFAttribute attribute)
attribute
- The DIFAttribute.
public java.lang.String setName(java.lang.String name)
java.lang.IllegalArgumentException
- If
Conventions.labelConvention(java.lang.String)
returns an error.public java.lang.String toString()
setName(java.lang.String)
method and names and values of the attributes.
Attributes are sorted according to their names so this description is
canonical.
toString
in class java.lang.Object
protected void _setContainer(java.lang.Object container)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |