j_waste.network
Class RoutingTable

java.lang.Object
  extended byj_waste.network.RoutingTable

public class RoutingTable
extends java.lang.Object

This class contains the routing table used in J-WASTE. Each entry consists of a GUID and a Connection, where the GUID identifies the route and the Connection is the next hop.

Version:
0.1
Author:
Mattias Ek (matek@users.sourceforge.net)

Constructor Summary
RoutingTable()
           
 
Method Summary
 void addRoute(GUID guid, Connection connection)
          Adds a new route to the routing table.
 void deleteRoute(GUID guid)
          Deletes the specified route from the routing table.
 Connection findRoute(GUID guid)
          Checks whether a route associated with the specified GUID exists in the routing table.
 int size()
          Returns the size of the routing table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoutingTable

public RoutingTable()
Method Detail

addRoute

public void addRoute(GUID guid,
                     Connection connection)
Adds a new route to the routing table.

Parameters:
guid - The 16-byte GUID to be associated with this route.
connection - The connection that is the next hop on this route.

deleteRoute

public void deleteRoute(GUID guid)
Deletes the specified route from the routing table.

Parameters:
guid - The GUID of the route to be deleted.

findRoute

public Connection findRoute(GUID guid)
Checks whether a route associated with the specified GUID exists in the routing table. If such route exists it is returned, else null is returned.

Parameters:
guid - The guid to search for in the routing table.
Returns:
The Connection that is the next hop on this route.

size

public int size()
Returns the size of the routing table.

Returns:
the size of the routing table.