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 intcompareTo(GraphElement arg0)voiddoSetTarget(Node target)Sets the target of the currentEdgeto target.NodegetSource()Returns the source of theEdge.NodegetTarget()Returns the target of theEdge.booleanisDirected()Returnstrue, if theEdgeis directed,falseotherwise.voidsetGraph(Graph graph)voidsetGraphToNull()StringtoString()Methods inherited from class org.graffiti.graph.AbstractEdge
reverse, setDirected, setSource, setTargetMethods inherited from class org.graffiti.graph.AbstractGraphElement
compareTo, getGraph, getID, getListenerManager, getViewID, setID, setViewIDMethods 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, setStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, setStringMethods inherited from interface org.graffiti.graph.Edge
reverse, setDirected, setSource, setTarget
-
Method Details
-
isDirected
public boolean isDirected()Returnstrue, if theEdgeis directed,falseotherwise.- Specified by:
isDirectedin interfaceEdge- Returns:
true, if theEdgeis directed,falseotherwise.
-
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 currentEdgeto target. Target must be contained in the sameGraphas 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:
compareToin interfaceComparable<GraphElement>
-