Package org.jtool.graph
Class GraphEdge
java.lang.Object
org.jtool.graph.GraphElement
org.jtool.graph.GraphEdge
- Direct Known Subclasses:
ControlFlow
,Dependence
An edge object for a graph.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests if a given edge is equal to this edge.boolean
equals
(GraphElement elem) Tests if a given graph element is equal to this graph element.protected long
getDstId()
Returns the identification number of the destination node of this edge.Returns the destination node for this edge.protected long
getSrcId()
Returns the identification number of the source node of this edge.Returns the source node for this edge.int
hashCode()
void
setDstNode
(GraphNode node) Sets a destination node for this edge.void
setSrcNode
(GraphNode node) Sets a source node for this edge.sortGrapgEdge
(Collection<? extends GraphEdge> collection) Sorts the list of edgestoString()
Obtains information on this edge.Methods inherited from class org.jtool.graph.GraphElement
difference, equals, equals, getIdString, intersection, subset, subsetEqual, union
-
Field Details
-
src
The source node of this edge. -
dst
The destination node of this edge.
-
-
Constructor Details
-
GraphEdge
Creates a new object that represents an edge connecting two nodes.- Parameters:
src
- the source node of this edgedst
- the destination node of this edge
-
-
Method Details
-
getSrcId
protected long getSrcId()Returns the identification number of the source node of this edge.- Returns:
- the identification number of the source node
-
getDstId
protected long getDstId()Returns the identification number of the destination node of this edge.- Returns:
- the identification number of the destination node
-
getSrcNode
Returns the source node for this edge.- Returns:
- the source node
-
getDstNode
Returns the destination node for this edge.- Returns:
- the destination node
-
setSrcNode
Sets a source node for this edge.- Parameters:
node
- the source node to be set
-
setDstNode
Sets a destination node for this edge.- Parameters:
node
- the destination node to be set
-
equals
Tests if a given graph element is equal to this graph element.- Specified by:
equals
in classGraphElement
- Parameters:
elem
- the graph element to be checked- Returns:
- the
true
if the given graph element is equal to this graph element
-
equals
Tests if a given edge is equal to this edge.- Parameters:
edge
- the edge to be checked- Returns:
- the
true
if the given edge is equal to this edge
-
hashCode
public int hashCode() -
toString
Obtains information on this edge. -
sortGrapgEdge
Sorts the list of edges- Parameters:
collection
- the list to be sorted- Returns:
- the sorted list of the edges
-