jfreerails.controller
Interface GraphExplorer

All Known Implementing Classes:
BuildTrackExplorer, FlatTrackExplorer

public interface GraphExplorer

This interface lets the caller explorer a graph while hiding the way the graph is stored. Vertices are packed into single ints to avoid the cost of object creation and garbage collection. 24-Nov-2002

Author:
Luke Lindsay

Method Summary
 int getEdgeCost()
          Returns the cost of the current edge.
 int getH()
           
 int getPosition()
          Return the current edge.
 int getVertexConnectedByEdge()
          Returns the vertex that is connected to the current vertex by the current edge.
 boolean hasNextEdge()
           
 void moveForward()
          Moves this GraphExplorer from the current vertex to the vertex that is connected to the current vertex by the current edge.
 void nextEdge()
          Sets the current edge to the current vertex's next edge.
 void setPosition(int vertex)
           
 

Method Detail

setPosition

void setPosition(int vertex)

getPosition

int getPosition()
Return the current edge.


nextEdge

void nextEdge()
Sets the current edge to the current vertex's next edge. Throws a NoSuchElementException if the vertex does not have another edge.


getVertexConnectedByEdge

int getVertexConnectedByEdge()
Returns the vertex that is connected to the current vertex by the current edge.


getEdgeCost

int getEdgeCost()
Returns the cost of the current edge.


hasNextEdge

boolean hasNextEdge()

moveForward

void moveForward()
Moves this GraphExplorer from the current vertex to the vertex that is connected to the current vertex by the current edge.


getH

int getH()