gecco.server.clock
Class SleepingThread
java.lang.Object
|
+--gecco.server.clock.SleepingThread
- All Implemented Interfaces:
- Comparable
- public class SleepingThread
- extends Object
- implements Comparable
Description of the Class
- Author:
- Karl Hasselström
Constructor Summary |
SleepingThread(Thread thread,
double wakeupTime)
Constructor for the SleepingThread object |
thread
public Thread thread
- Description of the Field
wakeupTime
public double wakeupTime
- Description of the Field
SleepingThread
public SleepingThread(Thread thread,
double wakeupTime)
- Constructor for the SleepingThread object
- Parameters:
thread
- Description of ParameterwakeupTime
- Description of Parameter
equals
public boolean equals(Object other)
- Tests whether two sleeping threads are equal.
- Overrides:
equals
in class Object
- Parameters:
other
- Should be a SleepingThread
.- Returns:
true
if a is equal to this automaton,
false
otherwise.
compareTo
public int compareTo(Object other)
- Compares this sleeping thread with another sleeping thread. First, their
wakeup times are compared, and if they are equal, the threads themselves
are compared.
- Specified by:
compareTo
in interface Comparable
- Parameters:
other
- Should be a SleepingThread
.- Returns:
- -1 if
this
is less than other
,
0 if they are equal, 1 if this
is greater than
other
.
toString
public String toString()
- Overrides:
toString
in class Object