Class GraphEdge

Direct Known Subclasses:
ControlFlow, Dependence

public abstract class GraphEdge extends GraphElement
An edge object for a graph.
  • Field Details

    • src

      protected GraphNode src
      The source node of this edge.
    • dst

      protected GraphNode dst
      The destination node of this edge.
  • Constructor Details

    • GraphEdge

      protected GraphEdge(GraphNode src, GraphNode dst)
      Creates a new object that represents an edge connecting two nodes.
      Parameters:
      src - the source node of this edge
      dst - 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

      public GraphNode getSrcNode()
      Returns the source node for this edge.
      Returns:
      the source node
    • getDstNode

      public GraphNode getDstNode()
      Returns the destination node for this edge.
      Returns:
      the destination node
    • setSrcNode

      public void setSrcNode(GraphNode node)
      Sets a source node for this edge.
      Parameters:
      node - the source node to be set
    • setDstNode

      public void setDstNode(GraphNode node)
      Sets a destination node for this edge.
      Parameters:
      node - the destination node to be set
    • equals

      public boolean equals(GraphElement elem)
      Tests if a given graph element is equal to this graph element.
      Specified by:
      equals in class GraphElement
      Parameters:
      elem - the graph element to be checked
      Returns:
      the true if the given graph element is equal to this graph element
    • equals

      public boolean equals(GraphEdge edge)
      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()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Obtains information on this edge.
      Overrides:
      toString in class Object
      Returns:
      the string representing the information
    • sortGrapgEdge

      protected static List<GraphEdge> sortGrapgEdge(Collection<? extends GraphEdge> collection)
      Sorts the list of edges
      Parameters:
      collection - the list to be sorted
      Returns:
      the sorted list of the edges