Interface Edge

All Superinterfaces:
Attributable, Comparable<GraphElement>, GraphElement
All Known Implementing Classes:
AbstractEdge, AdjListEdge

public interface Edge
extends GraphElement
Provides an interfaces for a GraphEdge. An Edge consists of source and target, directed edges point from source to target. Source, target and Edge must belong to the same Graph. Otherwise the copy-methods of the interface org.grafitti.graph.Graph have to be used.
Version:
$Revision: 1.4 $
See Also:
GraphElement, Node, Graph
  • Field Details

    • DIRECTED

      static final boolean DIRECTED
      Indicates that an Edge is directed.
      See Also:
      Constant Field Values
    • UNDIRECTED

      static final boolean UNDIRECTED
      Indicates that an Edge is undirected.
      See Also:
      Constant Field Values
  • Method Details

    • setDirected

      void setDirected​(boolean directed)
      Determines if an Edge is directed (true) or not.
      Parameters:
      directed - true, if the Edge is destined to be directed, false otherwise.
    • isDirected

      boolean isDirected()
      Returns true, if the Edge is directed, false otherwise.
      Returns:
      true, if the Edge is directed, false otherwise.
    • setSource

      void setSource​(Node source) throws GraphElementNotFoundException, IllegalArgumentException
      Sets the source of the current Edge to source. source must be contained in the same Graph as the current Edge. Informs the ListenerManager about the change.
      Parameters:
      source - the source to be set.
      Throws:
      GraphElementNotFoundException - if source cannot be found in the Graph.
      IllegalArgumentException - if source belongs to a different Graph.
    • getSource

      Node getSource()
      Returns the source of the current Edge.
      Returns:
      the source of the current Edge.
    • setTarget

      void setTarget​(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 belongs to a different Graph.
    • getTarget

      Node getTarget()
      Returns the target of the current Edge.
      Returns:
      the target of the current Edge.
    • reverse

      void reverse()
      Changes source and target of the Edge, that means if the Edge is directed the direction will be changed.
    • setGraph

      void setGraph​(Graph graph)
      Parameters:
      graph -