|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface extends the java.util.Comparator interface, which defines the compare() method. The extension defines additional methods that specifically support the CalendarQueue class. That class needs to associate an entry in the queue with a virtual bin number, and needs to be able to periodically recompute the width of its bins. Thus, merely being able to compare entries is not sufficient.
CalendarQueue,
Comparator
| Yellow (liuj) |
| Green (eal) |
| Method Summary | |
long |
getVirtualBinNumber(java.lang.Object entry)
Given an entry, return a virtual bin number for the entry. |
void |
setBinWidth(java.lang.Object[] entryArray)
Given an array of entries, set an appropriate bin width for a calendar queue to hold these entries. |
void |
setZeroReference(java.lang.Object zeroReference)
Set the zero reference, to be used in calculating the virtual bin number. |
| Methods inherited from interface java.util.Comparator |
compare, equals |
| Method Detail |
public long getVirtualBinNumber(java.lang.Object entry)
(entry - zeroReference) / binWidth,
with the result cast to long.Classes that implement this interface will in general need to perform a downcast on the arguments (of type Object) to the appropriate user defined classes. If the arguments are not of appropriate type, the implementation should throw a ClassCastException. Note that this method cannot return long.MAX_VALUE, which is used internally by the CalendarQueue.
entry - An object that can be inserted in a calendar queue.
public void setBinWidth(java.lang.Object[] entryArray)
entryArray - An array of entries.public void setZeroReference(java.lang.Object zeroReference)
zeroReference - The starting point for bins.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||