|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsalvo.jesus.graph.GraphImpl
salvo.jesus.graph.PathImpl
salvo.jesus.graph.SimplePathImpl
public class SimplePathImpl
Implementation of SimplePath interface guaranteeing that the path is simple, meaning no Vertex is repeated in the path.
Field Summary |
---|
Fields inherited from class salvo.jesus.graph.PathImpl |
---|
vertexStack |
Fields inherited from class salvo.jesus.graph.GraphImpl |
---|
addedgelistener, addvertexlistener, connectedSetS, edges, removeedgelistener, removevertexlistener, traversal, vertices |
Constructor Summary | |
---|---|
SimplePathImpl()
Creates an instance of SimplePathImpl. |
Method Summary | |
---|---|
void |
add(Vertex newVertex)
Adds a Vertex into the Path. |
void |
addEdge(Edge edge)
Adds an Edge into Path. |
private void |
validatePath(Vertex vertex)
Throws an exception if the vertex being added will result in a non-simple path. |
Methods inherited from class salvo.jesus.graph.PathImpl |
---|
getFirstVertex, getLastVertex, remove, remove, removeEdge, removeEdges, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface salvo.jesus.graph.Path |
---|
getFirstVertex, getLastVertex, remove |
Constructor Detail |
---|
public SimplePathImpl()
Method Detail |
---|
public void add(Vertex newVertex) throws java.lang.Exception
If adding this new Edge instance is not desired and you want to add an existing Edge instance instead ( i.e.: from an Edge in a Graph ), then you should call addEdge( Edge ) instead.
add
in interface Graph
add
in class PathImpl
newvertex
- Vertex to be added to the Path
IllegalPathException
- Thrown if adding the Vertex
will result to a non-simple Path.
java.lang.Exception
public void addEdge(Edge edge) throws java.lang.Exception
addEdge
in interface Graph
addEdge
in class PathImpl
edge
- The edge to be added to the Graph.
IllegalPathException
- Thrown when the vertexA
property of the Edge being added is not the last Vertex
in the path.
java.lang.Exception
private void validatePath(Vertex vertex) throws IllegalPathException
IllegalPathException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |