|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Routing.DSR.Route
public class Route
Route provides a convenient interface for dealing with routing chains with copy-on-write semantics. Route has a copy-on-write semantic so that any modification to a Route returns a new Route while leaving the original object unmodified. Therefore, a Route instance is immutable. This is the same technique used by java.lang.String.
Constructor Summary | |
---|---|
Route(java.lang.Integer... path)
|
Method Summary | |
---|---|
Route |
addHop(int address)
Adds a hop to the end of this Route. |
boolean |
containsAddress(int address)
|
boolean |
containsLink(int start,
int end)
Returns true if there is a link from 'start' to 'end' in this Route. |
boolean |
equals(java.lang.Object o)
|
int |
getFirstHop()
|
int |
getLastHop()
|
Route |
getRouteFrom(int address)
Returns the Route from the node with the given address onwards to the end, or null if the given node is not in Route. |
int |
getSecondHop()
Returns the hop following the first hop. |
int |
getSize()
Returns the size of this Route if it were to be serialized as bytes. |
int |
hashCode()
|
int |
numHops()
|
Route |
removeFirstHop()
|
Route |
removeLastHop()
|
Route |
reverse()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Route(java.lang.Integer... path)
Method Detail |
---|
public int numHops()
public boolean containsAddress(int address)
public Route getRouteFrom(int address)
public boolean containsLink(int start, int end)
public Route addHop(int address)
public int getFirstHop()
public int getSecondHop()
public int getLastHop()
public Route removeFirstHop()
public Route removeLastHop()
public Route reverse()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int getSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |