Package org.graffiti.graph
Class AdjListEdge
java.lang.Object
org.graffiti.attributes.AbstractAttributable
org.graffiti.graph.AbstractGraphElement
org.graffiti.graph.AbstractEdge
org.graffiti.graph.AdjListEdge
- All Implemented Interfaces:
Comparable<GraphElement>
,Attributable
,Edge
,GraphElement
public class AdjListEdge extends AbstractEdge implements Edge, GraphElement
Implementation of the
Edge
interface for a Graph
with adjacency list representation.- Version:
- $Revision: 1.8 $
- See Also:
AdjListGraph
,AdjListNode
-
Field Summary
Fields inherited from interface org.graffiti.graph.Edge
DIRECTED, UNDIRECTED
-
Method Summary
Modifier and Type Method Description int
compareTo(GraphElement arg0)
void
doSetTarget(Node target)
Sets the target of the currentEdge
to target.Node
getSource()
Returns the source of theEdge
.Node
getTarget()
Returns the target of theEdge
.boolean
isDirected()
Returnstrue
, if theEdge
is directed,false
otherwise.void
setGraph(Graph graph)
void
setGraphToNull()
String
toString()
Methods inherited from class org.graffiti.graph.AbstractEdge
reverse, setDirected, setSource, setTarget
Methods inherited from class org.graffiti.graph.AbstractGraphElement
compareTo, getGraph, getID, getListenerManager, getViewID, setID, setViewID
Methods inherited from class org.graffiti.attributes.AbstractAttributable
addAttribute, addBoolean, addByte, addDouble, addFloat, addInteger, addLong, addShort, addString, changeBoolean, changeByte, changeDouble, changeFloat, changeInteger, changeLong, changeShort, changeString, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
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, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getListenerManager, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setString
Methods inherited from interface org.graffiti.graph.Edge
reverse, setDirected, setSource, setTarget
-
Method Details
-
isDirected
public boolean isDirected()Returnstrue
, if theEdge
is directed,false
otherwise.- Specified by:
isDirected
in interfaceEdge
- Returns:
true
, if theEdge
is directed,false
otherwise.
-
getSource
Returns the source of theEdge
. -
getTarget
Returns the target of theEdge
. -
doSetTarget
public void doSetTarget(Node target) throws GraphElementNotFoundException, IllegalArgumentExceptionSets the target of the currentEdge
to target. Target must be contained in the sameGraph
as theEdge
. Informs the ListenerManager about the change.- Parameters:
target
- the target to be set.- Throws:
GraphElementNotFoundException
- if the target cannot be found in theGraph
.IllegalArgumentException
- if target is not of typeAdjListNode
.
-
setGraphToNull
public void setGraphToNull() -
setGraph
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<GraphElement>
-