salvo.jesus.graph
Interface Path

All Superinterfaces:
Graph, java.io.Serializable
All Known Subinterfaces:
CyclePath, SimplePath
All Known Implementing Classes:
CyclePathImpl, PathImpl, SimplePathImpl

public interface Path
extends Graph

An interface that abstracts a path in a graph. In this context, a path is a consecutive sequence of vertices from one vertex to another connected by edges.

The important word here is consecutive. Thus, implementations are required to make sure that if an Edge is added to a Path, that the Edge being added is between the last Vertex in the path to a new Vertex. If a Vertex is being added, that am Edge is created between the last Vertex in the Path to the new Vertex being added.

If an acyclic path is required, then implement the AcyclicPath interface instead.

Author:
Jesus M. Salvo Jr.

Method Summary
 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.
 
Methods inherited from interface salvo.jesus.graph.Graph
add, addEdge, addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, cloneVertices, createEdge, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getTraversal, getVertices, getVerticesCount, getVerticesIterator, isConnected, mergeconnectedSet, remove, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, setTraversal, traverse
 

Method Detail

getFirstVertex

Vertex getFirstVertex()
Returns the first Vertex in the Path.


getLastVertex

Vertex getLastVertex()
Returns the last Vertex in the Path.


remove

void remove()
            throws java.lang.Exception
Removes the last Vertex that was added in the Path.

Throws:
java.lang.Exception