Sim.Routing.Champ
Class RouteCache

java.lang.Object
  extended by Sim.Routing.Champ.RouteCache

public class RouteCache
extends java.lang.Object


Constructor Summary
RouteCache()
          Creates a new instance of RouteCache
 
Method Summary
 void addDestination(int numPaths, int dest, int distance, int successor)
          addDestination will add a destination to the routeCache
 void addSuccessor(int destination, int successor, int finalDistance)
          addSuccessor
 java.util.LinkedList<Destination> getDestinations()
           
 NextHop getNextHop(int destination)
           
 boolean isSuccessor(int node, int destination)
          isSuccessor will return true is the node passed to it is successor to destination
 int removeSuccessor(int address)
           
 void setDestinations(java.util.LinkedList<Destination> destinations)
           
 void setDestNextHop(int destination, int hop, int distanceToDest)
          setDestNextHop will set the next hop for this destination in the the route Cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteCache

public RouteCache()
Creates a new instance of RouteCache

Method Detail

getNextHop

public NextHop getNextHop(int destination)

isSuccessor

public boolean isSuccessor(int node,
                           int destination)
isSuccessor will return true is the node passed to it is successor to destination

Returns:
true if its a successor

addDestination

public void addDestination(int numPaths,
                           int dest,
                           int distance,
                           int successor)
addDestination will add a destination to the routeCache

Parameters:
numPaths - max allowed paths
dest - final destination
distance - total distance

addSuccessor

public void addSuccessor(int destination,
                         int successor,
                         int finalDistance)
addSuccessor

Parameters:
destination -
successor - next hop
finalDistance -

removeSuccessor

public int removeSuccessor(int address)

getDestinations

public java.util.LinkedList<Destination> getDestinations()

setDestinations

public void setDestinations(java.util.LinkedList<Destination> destinations)

setDestNextHop

public void setDestNextHop(int destination,
                           int hop,
                           int distanceToDest)
setDestNextHop will set the next hop for this destination in the the route Cache

Parameters:
destination -
hop - address of next hop
distance - to final destination