public class PathImpl extends GraphImpl
| Constructor and Description |
|---|
PathImpl()
Creates an instance of PathImpl.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Vertex newVertex)
Adds a Vertex into the Path.
|
Vertex |
getFirstVertex()
Returns the first Vertex in the Path.
|
Vertex |
getLastVertex()
Returns the last Vertex in the Path.
|
void |
remove()
Removes the last Vertex that was added in the Path.
|
protected void |
setListener(AbstractPathListener listener) |
String |
toString()
Returns a String representation of the Path.
|
addEdge, addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, containsEdge, containsVertex, forgetConnectedSets, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, remove, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddEdge, addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, remove, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverseprotected void setListener(AbstractPathListener listener)
public Vertex getFirstVertex()
PathgetFirstVertex in interface PathPath.getFirstVertex()public Vertex getLastVertex()
PathgetLastVertex in interface PathPath.getLastVertex()public void add(Vertex newVertex) throws Exception
This will call Graph.add( Vertex ) only if the Vertex is not yet part of the Graph. Note that this will also automatically add an Edge from the last Vertex that was added to the this Vertex being added.
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 Graphadd in class GraphImplnewvertex - Vertex to be added to the PathIllegalPathExceptionExceptionGraph.add(salvo.jesus.graph.Vertex)public void remove()
throws Exception
Copyright © 2019 JULIE Lab, Germany. All rights reserved.