org.graffiti.attributes
Interface Attributable

All Known Subinterfaces:
Edge, Graph, GraphElement, Node
All Known Implementing Classes:
AbstractAttributable, AbstractEdge, AbstractGraph, AbstractGraphElement, AbstractNode, AdjListEdge, AdjListGraph, AdjListNode, FastEdge, FastGraph, FastNode, OptAdjListGraph

public interface Attributable

Interfaces an object that contains a hierarchy of attributes. This interface defines methods for accessing and modifying this hierarchy.

Version:
$Revision: 5767 $
See Also:
AttributeTypesManager

Method Summary
 void addAttribute(Attribute attr, String path)
          Adds attr to the attributes at position indicated by path.
 void addBoolean(String path, String id, boolean value)
          Adds a BooleanAttribute with the given value and id to a CollectionAttribute at path.
 void addByte(String path, String id, byte value)
          Adds an ByteAttribute with the given value and id to a CollectionAttribute at path.
 void addDouble(String path, String id, double value)
          Adds a DoubleAttribute with the given value and id to a CollectionAttribute at path.
 void addFloat(String path, String id, float value)
          Adds a FloatAttribute with the given value and id to a CollectionAttribute at path.
 void addInteger(String path, String id, int value)
          Adds an IntegerAttribute with the given value and id to a CollectionAttribute at path.
 void addLong(String path, String id, long value)
          Adds an LongAttribute with the given value and id to a CollectionAttribute at path.
 void addShort(String path, String id, short value)
          Adds an ShortAttribute with the given value and id to a CollectionAttribute at path.
 void addString(String path, String id, String value)
          Adds an StringAttribute with the given value and id to a CollectionAttribute at path.
 void changeBoolean(String path, boolean value)
          Changes the Attribute at the given path to the given value.
 void changeByte(String path, byte value)
          Changes the Attribute at the given path to the given value.
 void changeDouble(String path, double value)
          Changes the Attribute at the given path to the given value.
 void changeFloat(String path, float value)
          Changes the Attribute at the given path to the given value.
 void changeInteger(String path, int value)
          Changes the Attribute at the given path to the given value.
 void changeLong(String path, long value)
          Changes the Attribute at the given path to the given value.
 void changeShort(String path, short value)
          Changes the Attribute at the given path to the given value.
 void changeString(String path, String value)
          Changes the Attribute at the given path to the given value.
 boolean containsAttribute(String path)
          Returns if the given path contains an Attribute of any kind.
 Attribute getAttribute(String path)
          Returns the Attribute located at the given path.
 CollectionAttribute getAttributes()
          Returns the attributes of the current object in the base hierarchie in a CollectionAttribute.
 boolean getBoolean(String path)
          Returns the value of the Attribute at the given path.
 byte getByte(String path)
          Returns the value of the Attribute at the given path.
 double getDouble(String path)
          Returns the value of the Attribute at the given path.
 float getFloat(String path)
          Returns the value of the Attribute at the given path.
 int getInteger(String path)
          Returns the value of the Attribute at the given path.
 ListenerManager getListenerManager()
          Returns the ListenerManager asscociated to this Attributable.
 long getLong(String path)
          Returns the value of the Attribute at the given path.
 short getShort(String path)
          Returns the value of the Attribute at the given path.
 String getString(String path)
          Returns the value of the Attribute at the given path.
 void removeAttribute(String path)
          Deletes the Attribute located at the given path from the attributes.
 void setBoolean(String path, boolean value)
          Sets the Attribute at the given path to the given value.
 void setByte(String path, byte value)
          Sets the Attribute at the given path to the given value.
 void setDouble(String path, double value)
          Sets the Attribute at the given path to the given value.
 void setFloat(String path, float value)
          Sets the Attribute at the given path to the given value.
 void setInteger(String path, int value)
          Sets the Attribute at the given path to the given value.
 void setLong(String path, long value)
          Sets the Attribute at the given path to the given value.
 void setShort(String path, short value)
          Sets the Attribute at the given path to the given value.
 void setString(String path, String value)
          Sets the Attribute at the given path to the given value.
 

Method Detail

getAttribute

Attribute getAttribute(String path)
                       throws AttributeNotFoundException
Returns the Attribute located at the given path.

Parameters:
path - the path to the Attribute.
Returns:
DOCUMENT ME!
Throws:
AttributeNotFoundException - if there is no Attribute at the location specified by path.

getAttributes

CollectionAttribute getAttributes()
Returns the attributes of the current object in the base hierarchie in a CollectionAttribute.

Returns:
the attributes of the current object.

setBoolean

void setBoolean(String path,
                boolean value)
Sets the Attribute at the given path to the given value. The Attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getBoolean

boolean getBoolean(String path)
                   throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

setByte

void setByte(String path,
             byte value)
Sets the Attribute at the given path to the given value. The Attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getByte

byte getByte(String path)
             throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

setDouble

void setDouble(String path,
               double value)
Sets the Attribute at the given path to the given value. The attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getDouble

double getDouble(String path)
                 throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

setFloat

void setFloat(String path,
              float value)
Sets the Attribute at the given path to the given value. The attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getFloat

float getFloat(String path)
               throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

setInteger

void setInteger(String path,
                int value)
Sets the Attribute at the given path to the given value. The Attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getInteger

int getInteger(String path)
               throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

getListenerManager

ListenerManager getListenerManager()
Returns the ListenerManager asscociated to this Attributable.

Returns:
the ListenerManager asscociated to this Attributable.

setLong

void setLong(String path,
             long value)
Sets the Attribute at the given path to the given value. The Attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getLong

long getLong(String path)
             throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

setShort

void setShort(String path,
              short value)
Sets the Attribute at the given path to the given value. The Attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getShort

short getShort(String path)
               throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

setString

void setString(String path,
               String value)
Sets the Attribute at the given path to the given value. The Attribute is created at the given location, if it does not yet exist.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.

getString

String getString(String path)
                 throws AttributeNotFoundException
Returns the value of the Attribute at the given path.

Parameters:
path - the path to search for the Attribute.
Returns:
the value of the Attribute at the given path.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

addAttribute

void addAttribute(Attribute attr,
                  String path)
                  throws AttributeExistsException,
                         NoCollectionAttributeException,
                         FieldAlreadySetException
Adds attr to the attributes at position indicated by path. Informs the ListenerManager about the change: calls preAttributeAdded and postAttributeAdded in the ListenManager. Also sets the parent and the attributable of attr.

Implementation Notes:path specifies the location of the CollectionAttribute or (in case path is the empty string) the Attributable attr should be added to. Usage should look as follows:

     Graph g = new Graph(..);
     CollectionAttribute ca = new CollectionAttribute("root");
     //add ca to the attributable g as root attribute
     g.addAttribute(ca, "");
     IntegerAttribute ia = new IntegerAttribute("int", 10);
     //add ia as child of root
     g.addAttribute(ia, "root");
 

Parameters:
attr - the Attribute to be added.
Throws:
AttributeExistsException - if there is already an Attribute with the same id as attr at location path.
NoCollectionAttributeException - if the Attribute at location path is not a CollectionAttribute.
FieldAlreadySetException

addBoolean

void addBoolean(String path,
                String id,
                boolean value)
                throws NoCollectionAttributeException,
                       AttributeExistsException,
                       FieldAlreadySetException
Adds a BooleanAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new IntegerAttribute should be added to.
id - the id of the newly created Attribute.
value - the value of the newly created Attribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addByte

void addByte(String path,
             String id,
             byte value)
             throws NoCollectionAttributeException,
                    AttributeExistsException,
                    FieldAlreadySetException
Adds an ByteAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new ByteAttribute should be added to.
id - the id of the new ByteAttribute.
value - the value of the new ByteAttribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addDouble

void addDouble(String path,
               String id,
               double value)
               throws NoCollectionAttributeException,
                      AttributeExistsException,
                      FieldAlreadySetException
Adds a DoubleAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new IntegerAttribute should be added to.
id - the id of the newly created Attribute.
value - the value of the newly created Attribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addFloat

void addFloat(String path,
              String id,
              float value)
              throws NoCollectionAttributeException,
                     AttributeExistsException,
                     FieldAlreadySetException
Adds a FloatAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new IntegerAttribute should be added to.
id - the id of the newly created Attribute.
value - the value of the newly created Attribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addInteger

void addInteger(String path,
                String id,
                int value)
                throws NoCollectionAttributeException,
                       AttributeExistsException,
                       FieldAlreadySetException
Adds an IntegerAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new IntegerAttribute should be added to.
id - the id of the new IntegerAttribute.
value - the value of the new IntegerAttribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addLong

void addLong(String path,
             String id,
             long value)
             throws NoCollectionAttributeException,
                    AttributeExistsException,
                    FieldAlreadySetException
Adds an LongAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new LongAttribute should be added to.
id - the id of the new LongAttribute.
value - the value of the new LongAttribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addShort

void addShort(String path,
              String id,
              short value)
              throws NoCollectionAttributeException,
                     AttributeExistsException,
                     FieldAlreadySetException
Adds an ShortAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new ShortAttribute should be added to.
id - the id of the new ShortAttribute.
value - the value of the new ShortAttribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

addString

void addString(String path,
               String id,
               String value)
               throws NoCollectionAttributeException,
                      AttributeExistsException,
                      FieldAlreadySetException
Adds an StringAttribute with the given value and id to a CollectionAttribute at path.

Parameters:
path - the path to the CollectionAttribute the new IntegerAttribute should be added to.
id - the id of the newly created Attribute.
value - the value of the newly created Attribute.
Throws:
NoCollectionAttributeException - if the Attribute at the location specified by path is no CollectionAttribute.
AttributeExistsException - if there is already an Attribute with the given id at the given path.
FieldAlreadySetException

changeBoolean

void changeBoolean(String path,
                   boolean value)
                   throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeByte

void changeByte(String path,
                byte value)
                throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeDouble

void changeDouble(String path,
                  double value)
                  throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeFloat

void changeFloat(String path,
                 float value)
                 throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeInteger

void changeInteger(String path,
                   int value)
                   throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeLong

void changeLong(String path,
                long value)
                throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeShort

void changeShort(String path,
                 short value)
                 throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

changeString

void changeString(String path,
                  String value)
                  throws AttributeNotFoundException
Changes the Attribute at the given path to the given value.

Parameters:
path - the path to search for the Attribute.
value - the value to set to the Attribute to.
Throws:
AttributeNotFoundException - if there is no Attribute at the specified location.

removeAttribute

void removeAttribute(String path)
                     throws AttributeNotFoundException
Deletes the Attribute located at the given path from the attributes. Informs the ListenerManager about the change: calls pre-/postAttributeRemoved in the ListenerManager.

Parameters:
path - the path of the Attribute to be removed.
Throws:
AttributeNotFoundException - if there is no Attribute at the location specified by path.

containsAttribute

boolean containsAttribute(String path)
Returns if the given path contains an Attribute of any kind.

Parameters:
path - The path of the Attribute to be tested.
Returns:
true, if an Attribute is saved in the given path, false otherwise.


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