MutualExclusion
Class LogicalTime
java.lang.Object
|
+--MutualExclusion.LogicalTime
- class LogicalTime
- extends java.lang.Object
Represents a logical time value with operations for checking for equality
and order.
Field Summary |
int |
clock
the clock value |
int |
process
for equal clock values the sender process's index is compared |
Constructor Summary |
LogicalTime(int clock,
int process)
a logical time object can only be constructed when both parameters are
known |
Method Summary |
boolean |
equals(java.lang.Object o)
checks for equality as defined for the Lamport logical time |
boolean |
lessThan(LogicalTime t)
check if the the current time is less than t as defined for the Lamport
logical time |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
clock
public int clock
- the clock value
process
public int process
- for equal clock values the sender process's index is compared
LogicalTime
public LogicalTime(int clock,
int process)
- a logical time object can only be constructed when both parameters are
known
equals
public boolean equals(java.lang.Object o)
- checks for equality as defined for the Lamport logical time
- Overrides:
equals
in class java.lang.Object
lessThan
public boolean lessThan(LogicalTime t)
- check if the the current time is less than t as defined for the Lamport
logical time
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object