T
- the weight type of this edgeE
- the edge type of the edge that this edge referencespublic final class RenamedEdge<T,E extends DirectedEdge<T,E> & java.lang.Comparable<? super E>>
extends java.lang.Object
AbstractRenamedEdge
Modifier and Type | Field and Description |
---|---|
protected int |
from |
E |
original |
protected int |
to |
Constructor and Description |
---|
RenamedEdge(int from,
int to,
E original)
Creates a new abstract renamed edge with new
from , to , internally referencing the original edge. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(R other) |
boolean |
equals(java.lang.Object o) |
int |
from()
Returns where the edge starts.
|
int |
hashCode() |
RenamedEdge<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.
|
protected final int from
protected final int to
public final E extends DirectedEdge<T,E> & java.lang.Comparable<? super E> original
public RenamedEdge(int from, int to, E original)
from
, to
, internally referencing the original edge.from
- the new fromto
- the new tooriginal
- the edge that this new edge should referencepublic RenamedEdge<T,E> reversed()
DirectedEdge
DirectedEdge.from()
and DirectedEdge.to()
swapped.DirectedEdge.from()
and DirectedEdge.to()
swappedpublic java.lang.String toString()
public int from()
DirectedEdge
from
in interface DirectedEdge<T,R extends util.graph.edge.AbstractRenamedEdge<T,E,R>>
public int to()
DirectedEdge
to
in interface DirectedEdge<T,R extends util.graph.edge.AbstractRenamedEdge<T,E,R>>
public T weight()
DirectedEdge
weight
in interface DirectedEdge<T,R extends util.graph.edge.AbstractRenamedEdge<T,E,R>>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(R other)
compareTo
in interface java.lang.Comparable<R extends util.graph.edge.AbstractRenamedEdge<T,E,R>>