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()
DirectedEdge
from
in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>
public int to()
DirectedEdge
to
in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>
public T weight()
DirectedEdge
weight
in interface DirectedEdge<T,IndexedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>>
public IndexedEdge<T,E> reversed()
DirectedEdge
DirectedEdge.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.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object