public class SimpleWeightedEdge extends Object implements WeightedEdge, Serializable
WeightedEdge
.Constructor and Description |
---|
SimpleWeightedEdge(int from,
int to,
double weight)
Creates a new edge from the specified vertex to the second vertex with
the corresponding weight.
|
Modifier and Type | Method and Description |
---|---|
<T extends Edge> |
clone(int from,
int to)
Clones the contents associated with this edge, returning the copy mapped
to the provided vertices.
|
boolean |
equals(Object o)
|
<T extends Edge> |
flip()
Returns a copy of this edge with the
from and to vertices swapped. |
int |
from()
Returns the index of the tail vertex
|
int |
hashCode() |
int |
to()
Returns the index of the head vertex
|
String |
toString() |
double |
weight()
Returns the weight for this edge.
|
public SimpleWeightedEdge(int from, int to, double weight)
public <T extends Edge> T clone(int from, int to)
public boolean equals(Object o)
public <T extends Edge> T flip()
from
and to
vertices swapped.public double weight()
weight
in interface WeightedEdge
Copyright © 2012. All Rights Reserved.