Package util

Class CompleteWeightedGraph.Edge

java.lang.Object
util.CompleteWeightedGraph.Edge
Enclosing class:
CompleteWeightedGraph<V,​W extends java.lang.Comparable<W>>

public class CompleteWeightedGraph.Edge
extends java.lang.Object
This class represents a weighted edge of the graph. It contains two vertices (whose order doesnt matter) and a weight between them.
  • Field Summary

    Fields
    Modifier and Type Field Description
    V vertex1
    One of the vertices of the edge.
    V vertex2
    The other vertex of the edge.
    W weight
    The weight of the edge.
  • Method Summary

    Modifier and Type Method Description
    boolean contains​(V vertex)
    Checks if the given vertex is one of the vertices of the edge.
    boolean equals​(java.lang.Object obj)  
    int hashCode()  

    Methods inherited from class java.lang.Object

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

    • vertex1

      public final V vertex1
      One of the vertices of the edge.
    • vertex2

      public final V vertex2
      The other vertex of the edge.
    • weight

      public final W extends java.lang.Comparable<W> weight
      The weight of the edge.
  • Method Details

    • contains

      public boolean contains​(V vertex)
      Checks if the given vertex is one of the vertices of the edge.
      Parameters:
      vertex - The vertex to check.
      Returns:
      true if the vertex is one of the vertices of the edge, or false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object