|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.actor.util.TimedEvent.TimeComparator
This class implements the CQComparator interface. It compares instances of TimedEvent. Therefore, all arguments passed to its methods have to be of type TimedEvent (or TimedEvent[] for the getBinWidth() method). If this is violated, ClassCastException will be thrown.
| Constructor Summary | |
TimedEvent.TimeComparator()
|
|
| Method Summary | |
int |
compare(java.lang.Object object1,
java.lang.Object object2)
Compare the two arguments. |
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 TimedEvent objects, find the appropriate bin width. |
void |
setZeroReference(java.lang.Object zeroReference)
Set the zero reference, to be used in calculating the virtual bin number. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
| Constructor Detail |
public TimedEvent.TimeComparator()
| Method Detail |
public final int compare(java.lang.Object object1,
java.lang.Object object2)
compare in interface java.util.Comparatorobject1 - The first event.object2 - The second event.
java.lang.ClassCastException - If either argument is not an instance
of TimedEvent.public long getVirtualBinNumber(java.lang.Object entry)
(entry.timeStamp - zeroReference) / binWidth,
with the result cast to long. If the arguments are not instances of TimedEvent, then a ClassCastException will be thrown.
getVirtualBinNumber in interface CQComparatorentry - The entry.
java.lang.ClassCastException - If the arguments are not instances of
TimedEvent.public void setBinWidth(java.lang.Object[] entryArray)
setBinWidth in interface CQComparatorentryArray - An array of TimedEvent objects.
java.lang.ClassCastException - If one of the array elements is not
an instance of TimedEvent.public void setZeroReference(java.lang.Object zeroReference)
setZeroReference in interface CQComparatorzeroReference - The starting point for bins.
java.lang.ClassCastException - If the argument is not an instance
of TimedEvent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||