All Packages Class Hierarchy This Package Previous Next Index
Class RouterLayer.Router.Reservation
RouterLayer.Router.Reservation
- public class Reservation
Reservation class to reserve message to the Router. The Reservation object
will be created by RouterRecvThread and it will be added to the _reservedBook
data member of RouterAction. While looping, the RouterAction will check
that the Reservation time. If the time is less than the current time,
the Router will send message to the reserved receiver.
-
Reservation(String, Address, String)
- Constructor
-
Reservation(String, Address, String, int)
- Constructor
-
getAddress()
- Get reserved address
-
getReceiver()
- Get intended receiver
-
getTime()
- Get reservation time as long
-
getTimeString()
- Get reservation time as string
-
getTrialTimes()
-
-
getTryTimes()
- Get trial times
-
incTimes()
- Increase trial times by one
-
overMaxTimes()
- Return true of the trial times is greater than the maximum trial times
-
setTime(long)
-
Reservation
public Reservation(String receiver,
Address address,
String time,
int maxTimes)
- Constructor
- Parameters:
- receiver - Intended receiver. May be different from the reserver
- address - Intended receiving location. Can be passed as null if the location
to receive is not different from the most recent connection location
- time - Reservation time stamp
- maxTimes - Maximum trial times
Reservation
public Reservation(String receiver,
Address address,
String time)
- Constructor
- Parameters:
- receiver - Intended receiver. May be different from the reserver
- address - Intended receiving location. Can be passed as null if the location
to receive is not different from the most recent connection location
- time - Reservation time stamp
incTimes
public void incTimes()
- Increase trial times by one
getTryTimes
public int getTryTimes()
- Get trial times
- Returns:
- Current trial times
getAddress
public Address getAddress()
- Get reserved address
- Returns:
- Reserved location address
getReceiver
public String getReceiver()
- Get intended receiver
- Returns:
- Intended receiver
getTimeString
public String getTimeString()
- Get reservation time as string
- Returns:
- Time stamp
getTime
public long getTime()
- Get reservation time as long
setTime
public void setTime(long time)
getTrialTimes
public int getTrialTimes()
overMaxTimes
public boolean overMaxTimes()
- Return true of the trial times is greater than the maximum trial times
- Returns:
- true if the trial times is greater than the maximum trial times
All Packages Class Hierarchy This Package Previous Next Index