annas.graph
Class GraphPath<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.GraphPath<N,A>
Type Parameters:
N - Node type
A - Arc type

public class GraphPath<N,A extends ArcInterface<N>>
extends java.lang.Object

Models a Path in a graph

Author:
Sam Wilson

Constructor Summary
GraphPath(N start, N end)
          Constructor
 
Method Summary
 void add(N node, A arc)
          Adds the next node into the path
 double getDistance()
          Gets the distance between the start node and end node
 java.util.Iterator<N> getIterator()
          Gets an iterator over the path
 int size()
          Number of nodes in the path
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphPath

public GraphPath(N start,
                 N end)
Constructor

Parameters:
start - start node of the path
end - end node of the path
Method Detail

add

public void add(N node,
                A arc)
Adds the next node into the path

Parameters:
node - Tail
arc -

size

public int size()
Number of nodes in the path

Returns:

getIterator

public java.util.Iterator<N> getIterator()
Gets an iterator over the path

Returns:

getDistance

public double getDistance()
Gets the distance between the start node and end node

Returns: