cgl.narada.service.buffering
Class NBEventComparator
java.lang.Object
cgl.narada.service.buffering.NBEventComparator
- All Implemented Interfaces:
- Comparator
public class NBEventComparator
- extends Object
- implements Comparator
Compares two NBEvent according to their timestamps.
|
Method Summary |
int |
compare(Object pFirst,
Object pSecond)
Compares two NBEvent according to the timestamp values they carry. |
int |
signum(long diff)
Maps positive numbers to 1, negative numbers to -1 and 0 to 0. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NBEventComparator
public NBEventComparator()
compare
public final int compare(Object pFirst,
Object pSecond)
- Compares two NBEvent according to the timestamp values they carry.
- Specified by:
compare in interface Comparator
- Parameters:
pFirst - NBEventpSecond - NBEvent
- Returns:
- int - comparison result. -1, 0 or 1 is returned
signum
public final int signum(long diff)
- Maps positive numbers to 1, negative numbers to -1 and 0 to 0.
- Parameters:
diff - value to be mapped
- Returns:
- int - -1, 0, or 1
For comments and suggestions please send
e-mail to
The NaradaBrokering Project