Class Edge<V>

java.lang.Object
com.aoapps.hodgepodge.graph.Edge<V>
Direct Known Subclasses:
LabeledEdge, WeightedEdge

public class Edge<V> extends Object
An edge (or arc) between two vertices.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final V
     
    protected final V
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Edge(V from, V to)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Two edges are equal if they have equal from and to.
    final V
    The vertex the edge is from.
    final V
    The vertex the edge is to.
    final int
    The hashCode is generated from the from and to.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • from

      protected final V from
    • to

      protected final V to
  • Constructor Details

    • Edge

      public Edge(V from, V to)
  • Method Details

    • getFrom

      public final V getFrom()
      The vertex the edge is from.
    • getTo

      public final V getTo()
      The vertex the edge is to.
    • toString

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

      public final boolean equals(Object obj)
      Two edges are equal if they have equal from and to.
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      The hashCode is generated from the from and to.
      Overrides:
      hashCode in class Object