org.graffiti.graph
Interface Edge

All Superinterfaces:
Attributable, GraphElement
All Known Implementing Classes:
AbstractEdge, AdjListEdge, FastEdge

public interface Edge
extends GraphElement

Provides an interfaces for a GraphEdge. An Edge consists of source and target, directed edges point from source to target. Source, target and Edge must belong to the same Graph. Otherwise the copy-methods of the interface org.grafitti.graph.Graph have to be used.

Version:
$Revision: 5767 $
See Also:
GraphElement, Node, Graph

Field Summary
static boolean DIRECTED
          Indicates that an Edge is directed.
static boolean UNDIRECTED
          Indicates that an Edge is undirected.
 
Method Summary
 Node getSource()
          Returns the source of the current Edge.
 Node getTarget()
          Returns the target of the current Edge.
 boolean isDirected()
          Returns true, if the Edge is directed, false otherwise.
 void reverse()
          Changes source and target of the Edge, that means if the Edge is directed the direction will be changed.
 void setDirected(boolean directed)
          Determines if an Edge is directed (true) or not.
 void setSource(Node source)
          Sets the source of the current Edge to source.
 void setTarget(Node target)
          Sets the target of the current Edge to target.
 
Methods inherited from interface org.graffiti.graph.GraphElement
getGraph, remove
 
Methods inherited from interface org.graffiti.attributes.Attributable
addAttribute, addBoolean, addByte, addDouble, addFloat, addInteger, addLong, addShort, addString, changeBoolean, changeByte, changeDouble, changeFloat, changeInteger, changeLong, changeShort, changeString, containsAttribute, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getListenerManager, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setString
 

Field Detail

DIRECTED

static final boolean DIRECTED
Indicates that an Edge is directed.

See Also:
Constant Field Values

UNDIRECTED

static final boolean UNDIRECTED
Indicates that an Edge is undirected.

See Also:
Constant Field Values
Method Detail

setDirected

void setDirected(boolean directed)
Determines if an Edge is directed (true) or not.

Parameters:
directed - true, if the Edge is destined to be directed, false otherwise.

isDirected

boolean isDirected()
Returns true, if the Edge is directed, false otherwise.

Returns:
true, if the Edge is directed, false otherwise.

setSource

void setSource(Node source)
               throws GraphElementNotFoundException,
                      IllegalArgumentException
Sets the source of the current Edge to source. source must be contained in the same Graph as the current Edge. Informs the ListenerManager about the change.

Parameters:
source - the source to be set.
Throws:
GraphElementNotFoundException - if source cannot be found in the Graph.
IllegalArgumentException - if source belongs to a different Graph.

getSource

Node getSource()
Returns the source of the current Edge.

Returns:
the source of the current Edge.

setTarget

void setTarget(Node target)
               throws GraphElementNotFoundException,
                      IllegalArgumentException
Sets the target of the current Edge to target. target must be contained in the same Graph as the Edge. Informs the ListenerManager about the change.

Parameters:
target - the target to be set.
Throws:
GraphElementNotFoundException - if the target cannot be found in the Graph.
IllegalArgumentException - if target belongs to a different Graph.

getTarget

Node getTarget()
Returns the target of the current Edge.

Returns:
the target of the current Edge.

reverse

void reverse()
Changes source and target of the Edge, that means if the Edge is directed the direction will be changed.



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