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 from, ID to)
      Creates an EdgeKey with given from and to params.
      Parameters:
      from - vertex id
      to - vertex id
  • Method Details

    • getFrom

      public final ID getFrom()
      Returns 'from' vertex id.
      Returns:
      from id of vertex
    • getTo

      public final ID getTo()
      Returns 'to' vertex id.
      Returns:
      to id of vertex