Class 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
  • Method Details

    • isDirected

      public boolean isDirected()
      Returns true, if the Edge is directed, false otherwise.
      Specified by:
      isDirected in interface Edge
      Returns:
      true, if the Edge is directed, false otherwise.
    • getSource

      public Node getSource()
      Returns the source of the Edge.
      Specified by:
      getSource in interface Edge
      Returns:
      the source of the Edge.
    • getTarget

      public Node getTarget()
      Returns the target of the Edge.
      Specified by:
      getTarget in interface Edge
      Returns:
      the target of the Edge.
    • doSetTarget

      public void doSetTarget​(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 is not of type AdjListNode.
    • setGraphToNull

      public void setGraphToNull()
    • setGraph

      public void setGraph​(Graph graph)
      Specified by:
      setGraph in interface Edge
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo​(GraphElement arg0)
      Specified by:
      compareTo in interface Comparable<GraphElement>