/*
* This method returns the path from the source to the selected target and NULL if no path exists
*/
public LinkedList<OrientVertex> getPath() {
final LinkedList<OrientVertex> path = new LinkedList<OrientVertex>();
OrientVertex step = paramDestinationVertex;
// Check if a path exists
if (predecessors.get(step.getIdentity()) == null)
return null;
path.add(step);
while (predecessors.get(step.getIdentity()) != null) {
step = predecessors.get(step.getIdentity());
path.add(step);
}
// Put it into the correct order
Collections.reverse(path);
return path;