|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRoutingTable
public class RoutingTable
For simplicity, there is only one routing table class. It keeps next-hop information, which they all do. It also keeps distance to the destination, which not all need or do.
These routing tables can create a vector of changes made to them. This is useful in sending 'diffs' around in update packets.
Nested Class Summary | |
---|---|
class |
RoutingTable.Entry
A class encapsulated the notion of a routing table entry. |
Field Summary | |
---|---|
protected boolean |
doLog
Controls whether or not logging is performed. |
protected java.util.Vector<RoutingTable.LogEntry> |
log
The 'diff' log used to record changes to the table. |
protected RoutingTable.Entry[] |
table
The actual routing table. |
Constructor Summary | |
---|---|
RoutingTable()
Routing tables are always the size of the number of nodes in the sole Network object that exists. |
Method Summary | |
---|---|
void |
addLogEntry(Node dest)
Adds an entry to the log. |
void |
cleanTable()
Clears out the table -- throws away all next hop information and and log info that might exist, and turns off logging. |
void |
clearTableOf(Node badNode)
Eliminates all entries that have the given node as their next hop, and makes distance to the destination infinite. |
int |
getDistTo(Node dest)
|
Node |
getHopTo(Node dest)
|
java.util.Vector<RoutingTable.LogEntry> |
getLog()
Accessor for log. |
boolean |
isLogging()
Returns true if table is currently logging changes, false otherwise. |
void |
setEntry(Node dest,
Node next,
int d)
Sets an entry -- both next hop and distance. |
int |
size()
Returns the number of entries in the routing table. |
void |
startLog()
Indicate that want to keep log of changes starting now. |
void |
stopLog()
Turn off logging. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected RoutingTable.Entry[] table
protected java.util.Vector<RoutingTable.LogEntry> log
protected boolean doLog
Constructor Detail |
---|
public RoutingTable()
Method Detail |
---|
public int size()
public void startLog()
public void stopLog()
public boolean isLogging()
public java.util.Vector<RoutingTable.LogEntry> getLog()
public Node getHopTo(Node dest)
public int getDistTo(Node dest)
public void setEntry(Node dest, Node next, int d)
public void addLogEntry(Node dest)
public void clearTableOf(Node badNode)
public void cleanTable()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |