org.graffiti.attributes
Interface Attribute

All Superinterfaces:
DeepCopy, Displayable<Object>
All Known Subinterfaces:
CollectionAttribute, SortedCollectionAttribute
All Known Implementing Classes:
AbstractAttribute, AbstractCollectionAttribute, BooleanAttribute, ByteAttribute, ColorAttribute, CompositeAttribute, CoordinateAttribute, DimensionAttribute, DockingAttribute, DoubleAttribute, EdgeGraphicAttribute, EdgeLabelAttribute, EdgeLabelPositionAttribute, EdgeShapeAttribute, FloatAttribute, GraphElementGraphicAttribute, GraphGraphicAttribute, GridAttribute, GridClassAttribute, GridOriginAttribute, GridParametersAttribute, HashMapAttribute, ImageAttribute, IntegerAttribute, LabelAttribute, LineModeAttribute, LinkedHashMapAttribute, LongAttribute, NodeGraphicAttribute, NodeLabelAttribute, NodeLabelPositionAttribute, NodeShapeAttribute, ObjectAttribute, PortAttribute, PortsAttribute, PositionAttribute, RenderedImageAttribute, ShapeDescriptionAttribute, ShortAttribute, SnapOnGridAttribute, SnapOnGridAttribute.SnapEnabledAttribute, SnapOnGridAttribute.ToleranceAttribute, StringAttribute

public interface Attribute
extends Displayable<Object>, DeepCopy

Interfaces an object, which contains an id and a value. An Attribute may contain other Attribute instances and thereby form a complete attribute hierarchy.

Version:
$Revision: 5767 $
See Also:
AttributeTypesManager

Field Summary
static String SEPARATOR
          The path separator for the attributes hierarchy.
 
Method Summary
 Attributable getAttributable()
          Returns the attributable the Attribute belongs to.
 String getId()
          Returns the Attribute's identifier.
 CollectionAttribute getParent()
          Returns the Attribute's parent.
 String getPath()
          Returns the Attribute's path.
 Object getValue()
          Returns the value of this Attribute.
 void setDefaultValue()
          The attribute's value is set so that its getValue() method will not return null.
 void setParent(CollectionAttribute parent)
          Sets the Attribute's parent.
 void setValue(Object v)
          Sets the value of this Attribute to the given value.
 String toString(int n)
          Returns a string representation prepended by n spaces of this attribute.
 
Methods inherited from interface org.graffiti.plugin.Displayable
getDescription, getName, setDescription, toXMLString
 
Methods inherited from interface org.graffiti.core.DeepCopy
copy
 

Field Detail

SEPARATOR

static final String SEPARATOR
The path separator for the attributes hierarchy.

See Also:
Constant Field Values
Method Detail

getAttributable

Attributable getAttributable()
Returns the attributable the Attribute belongs to.

Returns:
the Attribute's attributable.

setDefaultValue

void setDefaultValue()
The attribute's value is set so that its getValue() method will not return null.


getId

String getId()
Returns the Attribute's identifier.

Returns:
the Attribute's identifier.

setParent

void setParent(CollectionAttribute parent)
               throws FieldAlreadySetException
Sets the Attribute's parent. Implementation Note: This function should only work if the Attribute's parent is null before. Normaly only addAttribute() methods should call it.

Parameters:
parent - the Attribute's parent.
Throws:
FieldAlreadySetException - if the parent was already set before

getParent

CollectionAttribute getParent()
Returns the Attribute's parent. If this is already the root Attribute, null is returned.

Returns:
the Attribute's parent.

getPath

String getPath()
Returns the Attribute's path.

Returns:
the Attribute's path.

setValue

void setValue(Object v)
              throws IllegalArgumentException
Sets the value of this Attribute to the given value. If the value is set via att.setValue(x) and then retrieved via y = att.getValue() it is only guaranteed that x.equals(y) not x==y, i.e. some particular implementations can provide x==y but this behaviour is not general, in contrast x.equals(y) must be always guaranteed.

Specified by:
setValue in interface Displayable<Object>
Parameters:
v - the new value.
Throws:
IllegalArgumentException - if v is not of the apropriate type.

getValue

Object getValue()
Returns the value of this Attribute. If the value is set via att.setValue(x) and then retrieved via y = att.getValue() it is only guaranteed that x.equals(y) not x==y, i.e. some particular implementations can provide x==y but this behaviour is not general, in contrast x.equals(y) must be always guaranteed. See documentation of particular implementations of this interface for exact specification of this method's behaviour!

Specified by:
getValue in interface Displayable<Object>
Returns:
the value of this Attribute.

toString

String toString(int n)
Returns a string representation prepended by n spaces of this attribute.

Returns:
DOCUMENT ME!


Generated at 2012-05-30 11:00:36 PM CEST