T
- Generic objectpublic static final class Grafo.Edge<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
cost |
private Grafo.Vertex<T> |
from |
private boolean |
mark |
private Grafo.Vertex<T> |
to |
Constructor and Description |
---|
Edge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to)
Create a zero cost edge between from and to
|
Edge(Grafo.Vertex<T> from,
Grafo.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
|
Grafo.Vertex<T> |
getFrom()
Get the starting vertex
|
Grafo.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
|
private Grafo.Vertex<T> from
private Grafo.Vertex<T> to
private int cost
private boolean mark
public Edge(Grafo.Vertex<T> from, Grafo.Vertex<T> to)
from
- the starting vertexto
- the ending vertexpublic Edge(Grafo.Vertex<T> from, Grafo.Vertex<T> to, int cost)
from
- the starting vertexto
- the ending vertexcost
- the cost of the edgepublic Grafo.Vertex<T> getTo()
public Grafo.Vertex<T> getFrom()
public int getCost()
public void mark()
public void clearMark()
public boolean isMarked()
public java.lang.String toString()
toString
in class java.lang.Object