Class Edge

java.lang.Object
jdg.graph.Edge

public class Edge extends Object
A class for representing an undirected of a graph, as an unordered pair of nodes
Author:
Luca Castelli Aleardi (Ecole Polytechnique, feb 2021)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    extremities of the edge
    int
    an integer useful for indexing this edge
    extremities of the edge
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initialize an empty edge
    Edge(Node a, Node b, int index)
    Initialize an edge (a, b)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check whether two points have equal coordinates
    int
     

    Methods inherited from class java.lang.Object

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

    • index

      public int index
      an integer useful for indexing this edge
    • first

      public Node first
      extremities of the edge
    • second

      public Node second
      extremities of the edge
  • Constructor Details

    • Edge

      public Edge()
      Initialize an empty edge
    • Edge

      public Edge(Node a, Node b, int index)
      Initialize an edge (a, b)
  • Method Details

    • equals

      public boolean equals(Object o)
      Check whether two points have equal coordinates
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object