|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.distributed.api.Clock
Clock Used to implement Vector Clock
| Field Summary | |
static int |
LAMPORT_CLOCK
Constant used within the class |
static int |
NO_CLOCK
Constant used within the class |
static int |
VECTOR_CLOCK
Constant used within the class |
| Constructor Summary | |
Clock()
Default Constructor |
|
Clock(Clock c)
Copy Constructor |
|
Clock(int n,
int id)
Constructor to be normally used by Environment |
|
Clock(int n,
int id,
java.lang.String c)
Constructor to be normally used by Environment |
|
| Method Summary | |
int |
compare(Clock c)
Method to compare a clock with this object |
static int |
compare(Clock myClock,
Clock hisClock)
Method to compare two clocks |
void |
incrClock(Event e,
Clock r)
Method used to increment Clock |
boolean |
isComparable(Clock c)
Method to see if this object and another clock are comparable or not |
static boolean |
isComparable(Clock myClock,
Clock hisClock)
Method to check if two clocks are comparable or not |
int |
lamportClock()
Method to return value of Lamport's clock at this point |
static int |
lamportClock(java.lang.String c)
methos to return Lamport Clock value from String |
java.lang.String |
toString(int convertion_type)
Method to convert Clock into String |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LAMPORT_CLOCK
public static final int NO_CLOCK
public static final int VECTOR_CLOCK
| Constructor Detail |
public Clock()
public Clock(Clock c)
c - The Clock to be Copied from
public Clock(int n,
int id)
throws java.lang.Exception
n - No. of Processes in systemid - Id of this process
java.lang.Exception - Wrong Parameters
public Clock(int n,
int id,
java.lang.String c)
throws java.lang.Exception
n - No. of Processes in systemid - Id of this processc - Contains Clock vector in string form
java.lang.Exception - Wrong Parameters| Method Detail |
public int compare(Clock c)
c - Object to be compared to
public static int compare(Clock myClock,
Clock hisClock)
myClock - First ClockhisClock - Second Clock
public void incrClock(Event e,
Clock r)
throws java.lang.Exception
e - Type of Eventr - Clock value if used to increment after receive event
java.lang.Exception - On mismatch of any Parameterspublic boolean isComparable(Clock c)
c - Object to be check with
public static boolean isComparable(Clock myClock,
Clock hisClock)
myClock - First ClockhisClock - Second Clock
public int lamportClock()
public static int lamportClock(java.lang.String c)
throws java.lang.NumberFormatException
c - Contains Clock value
java.lang.NumberFormatException - if unable to extract lamports clockpublic java.lang.String toString(int convertion_type)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||