Class EdgeKey<ID>

java.lang.Object
com.github.moaxcp.graphs.EdgeKey<ID>
Type Parameters:
ID - type of identifiers
Direct Known Subclasses:
DirectedEdgeKey, UndirectedEdgeKey

public abstract class EdgeKey<ID> extends Object
Key for identifying edges within a collection such as Map. Extensions of this class define how two edges are equal in terms of the graph. Implementing classes must define equals and hashCode for the type of Edge used in the graph. Classes implementing AbstractGraph should typically use DirectedEdgeKey or UndirectedEdgeKey instead of extending this class.
  • Constructor Details

    • EdgeKey

      public EdgeKey(ID source, ID target)
      Creates an EdgeKey with given source and target params.
      Parameters:
      source - vertex id
      target - vertex id
  • Method Details

    • getSource

      public final ID getSource()
      Returns source vertex id.
      Returns:
      source id of vertex
    • getTarget

      public final ID getTarget()
      Returns target vertex id.
      Returns:
      target id of vertex