|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Routing.GPSR.Header.Standard
public class Standard
This is the basic header that is needed by GPSR. It contains two modes which will use more or less fields. Mainly, for greedy routing, only the mode (obviously), toAddress, fromAddress and fromLocation (for updating purposes), and the finalLocationa are used.
Field Summary | |
---|---|
PacketId |
id
|
Constructor Summary | |
---|---|
Standard(PacketId id,
int mode,
int fromAddress,
Location fromLocation,
Location finalLocation)
The constructor to create a new frame for sending a packet to a destination. |
|
Standard(PacketId id,
int mode,
int fromAddress,
Location fromLocation,
Location finalLocation,
Location perimeterStarted)
|
Method Summary | |
---|---|
double |
getEdge()
|
Location |
getFaceLocation()
|
Location |
getFinalLocation()
The end destination of the node that is to receive the packet. |
int |
getFromAddress()
The address of the node that sent this header. |
Location |
getFromLocation()
The location of the node that sent this header. |
int |
getMode()
Return the mode that this packet is currently routing in. |
Location |
getPerimeterStarted()
|
int |
getSize()
Returns the "serialized" size of this portion of the packet. |
void |
setEdge(double edge)
|
void |
setFaceLocation(Location faceLocation)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final PacketId id
Constructor Detail |
---|
public Standard(PacketId id, int mode, int fromAddress, Location fromLocation, Location finalLocation)
id
- a unique id for this frame.mode
- a field indicating if the packet is traveling in greedy or perimeter mode.toAddress
- the next node this header is intended for.fromAddress
- the address of node this was sent from, purely for updating neighbors.fromLocation
- the location of the sender node, purely for updating neighbors.finalLocation
- the end location that this is to be sent to.public Standard(PacketId id, int mode, int fromAddress, Location fromLocation, Location finalLocation, Location perimeterStarted)
Method Detail |
---|
public int getSize()
getSize
in interface ProtocolFrame
public int getFromAddress()
getFromAddress
in interface Base
public Location getFromLocation()
getFromLocation
in interface Base
public Location getFinalLocation()
public int getMode()
public Location getPerimeterStarted()
public Location getFaceLocation()
public void setFaceLocation(Location faceLocation)
public double getEdge()
public void setEdge(double edge)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |