de.ipk_gatersleben.ag_nw.centilib.plugin
Interface DoubleAttribute<T>

Type Parameters:
T - Type of object this Interface is an Attribute for (e.g. the type of the node data structure)
All Known Implementing Classes:
DefaultEdgeAttribute

public interface DoubleAttribute<T>

The DoubleAttribute enables access to a specific attribute of any type of objects. CentiLib uses this Interface to handle node and edge attributes.

Author:
Johannes Graessler

Method Summary
 String getName()
          The name of the attribute.
 Double getValue(T element)
          Returns the attribute value for element if it exists, null or Double.NaN otherwise.
 String toString()
          The method toString() should be overwritten to return the name of the attribute.
 

Method Detail

toString

String toString()
The method toString() should be overwritten to return the name of the attribute. For example, toString is used by the drop-down list, if the user wants to select an edge attribute as edge weights in the Graph Statistics panel.

Overrides:
toString in class Object
Returns:
the name of the attribute

getName

String getName()
The name of the attribute.

Returns:
the name of the attribute

getValue

Double getValue(T element)
Returns the attribute value for element if it exists, null or Double.NaN otherwise.

Parameters:
element - the object to get the attribute value for
Returns:
the attribute value for the given element