public class ReceiverComparator
extends java.lang.Object
implements java.util.Comparator
If it is determined that two receivers are equivalent according to ReceiverTime, then comparison is made according to the receiver priority. A larger receiver priority will precede a smaller receiver priority. If it is determined that two receivers are equivalent according to ReceiverTime and priority, then the compare() method returns 0.
DDEThread
Constructor and Description |
---|
ReceiverComparator(TimeKeeper timeKeeper)
Construct a ReceiverComparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object object1,
java.lang.Object object2)
Compare two receivers according to ReceiverTime and priority.
|
public ReceiverComparator(TimeKeeper timeKeeper)
timeKeeper
- The time keeper that controls the receivers.public int compare(java.lang.Object object1, java.lang.Object object2)
compare
in interface java.util.Comparator
object1
- The first object to be compared.object2
- The second object to be compared.java.lang.ClassCastException
- If object1 and obj2 are
not instances of PrioritizedTimedQueue.