T - public class Edge<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private int |
cost |
private Vertex<T> |
from |
private boolean |
mark |
private Vertex<T> |
to |
| Constructor and Description |
|---|
Edge(Vertex<T> from,
Vertex<T> to)
Create a zero cost edge between from and to
|
Edge(Vertex<T> from,
Vertex<T> to,
int cost)
Create an edge between from and to with the given cost.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearMark()
Clear the edge mark flag
|
int |
getCost()
Get the cost of the edge
|
Vertex<T> |
getFrom()
Get the starting vertex
|
Vertex<T> |
getTo()
Get the ending vertex
|
boolean |
isMarked()
Get the edge mark flag
|
void |
mark()
Set the mark flag of the edge
|
java.lang.String |
toString()
String rep of edge
|
public Edge(Vertex<T> from, Vertex<T> to)
from - the starting vertexto - the ending vertexpublic int getCost()
public void mark()
public void clearMark()
public boolean isMarked()
public java.lang.String toString()
toString in class java.lang.Object