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
-
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
vertex1
One of the vertices of the edge. -
vertex2
The other vertex of the edge. -
weight
The weight of the edge.
-
-
Method Details
-
contains
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-