net.spy.util
Class ShortestPath<N extends SPNode<N>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<N>
              extended by net.spy.util.ShortestPath<N>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<N>, java.util.Collection<N>, java.util.List<N>, java.util.RandomAccess

public class ShortestPath<N extends SPNode<N>>
extends java.util.ArrayList<N>

Represents the shortest path between two SPNodes. This class can be used to find and store the shortest path between two SPNode instances.

See Also:
ShortestPathFinder, Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ShortestPath(N from, N to)
          Get an instance of ShortestPath.
 
Method Summary
 int getCost()
          Get the cost of this path.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ShortestPath

public ShortestPath(N from,
                    N to)
             throws NoPathException
Get an instance of ShortestPath.

Parameters:
from - the starting node
to - the ending node
Throws:
NoPathException - if there's no path to the destination
java.lang.NullPointerException - if from or to is null
Method Detail

getCost

public int getCost()
Get the cost of this path.



Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.