V
- the type of the vertices of the graphpublic interface Vertible<V extends Vertible<V>>
Graph
Modifier and Type | Method and Description |
---|---|
V |
copy()
Creates and returns a new copy of this object.
|
V[] |
getAdjacency()
Returns the adjacency list of this vertex as specified by the
graph it belongs to.
|
double |
getDistance()
Returns the distance of the shortest path from a
specified source to this vertex as determined by the Dijkstra algorithm.
|
int |
getIndex()
Returns the index of this vertex as specified by the graph it belongs to.
|
String |
getName()
Returns the name of this vertex.
|
V |
getPredecessor()
Returns the predecessor of this vertex in the shortest path from a
specified source as determined by the Dijkstra algorithm.
|
boolean |
isInProcess()
Returns a flag if this vertex is in process.
|
boolean |
isMarked()
Returns a flag if this vertex is marked.
|
void |
mark()
Marks this vertex as true.
|
void |
setAdjacency(V[] adjacency)
Sets the adjacency list of this vertex as specified by the
graph it belongs to.
|
void |
setDistance(double distance)
Sets the distance of the shortest path from a
specified source to this vertex as determined by the Dijkstra algorithm.
|
void |
setIndex(int index)
Sets the index of this vertex as specified by the graph it belongs to.
|
void |
setInProcess(boolean inProcess)
Sets this vertex process flag to the specified value.
|
void |
setMarked(boolean marked)
Sets this vertex mark flag to the specified value.
|
void |
setName(String name)
Sets the index of this vertex as specified by the graph it belongs to.
|
void |
setPredecessor(V predecessor)
Sets the predecessor of this vertex in the shortest path from a
specified source as determined by the Dijkstra algorithm.
|
V copy()
x.copy() != x
is true.
The typical implementation in a class VertexClazz
implementing this interface could simply look like
return new VertexClazz(...)
.void setName(String name)
name
- the name of this vertex in the graphString getName()
int getIndex()
void setIndex(int index)
index
- the index of this vertex in the graphV[] getAdjacency()
void setAdjacency(V[] adjacency)
adjacency
- the adjacency list this vertexV getPredecessor()
void setPredecessor(V predecessor)
predecessor
- the predecessor of this vertex in the shortest pathWeightedGraph
double getDistance()
WeightedGraph
void setDistance(double distance)
distance
- the distance of this vertex in the shortest pathvoid mark()
void setMarked(boolean marked)
marked
- flag which marks this vertexboolean isMarked()
true
if and only this vertex is markedboolean isInProcess()
true
if and only this vertex is markedvoid setInProcess(boolean inProcess)
inProcess
- flag which marks this vertex