T - the weight type of this edgeE - the edge type of the edge that this edge referencespublic final class IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>> extends java.lang.Object implements DirectedEdge<T,IndexedEdge<T,E>>, java.lang.Comparable<IndexedEdge<T,E>>
PrecomputedMSTCollection| Constructor and Description |
|---|
IndexedEdge(int index,
E edge)
Creates a new indexed edge with the given index, referencing the given edge
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IndexedEdge<T,E> other) |
boolean |
equals(java.lang.Object o) |
int |
from()
Returns where the edge starts.
|
int |
hashCode() |
IndexedEdge<T,E> |
reversed()
Returns a new edge with
DirectedEdge.from() and DirectedEdge.to() swapped. |
int |
to()
Returns where the edge ends.
|
java.lang.String |
toString() |
T |
weight()
Returns the weight of the edge.
|
public final int index
public final E extends DirectedEdge<T,E> & java.lang.Comparable<? super E> edge
public IndexedEdge(int index,
E edge)
index - the index of this edgeedge - the edge this edge referencespublic int compareTo(IndexedEdge<T,E> other)
compareTo in interface java.lang.Comparable<IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>public int from()
DirectedEdgefrom in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>public int to()
DirectedEdgeto in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>public T weight()
DirectedEdgeweight in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>public IndexedEdge<T,E> reversed()
DirectedEdgeDirectedEdge.from() and DirectedEdge.to() swapped.reversed in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>DirectedEdge.from() and DirectedEdge.to() swappedpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object