Package ptolemy.domains.ptides.kernel
Class PtidesReceiver.TagComparator
- java.lang.Object
-
- ptolemy.domains.ptides.kernel.PtidesReceiver.TagComparator
-
- All Implemented Interfaces:
java.util.Comparator
- Enclosing class:
- PtidesReceiver
public static class PtidesReceiver.TagComparator extends java.lang.Object implements java.util.Comparator
Compare two events according to - time stamp - value did not find a way to compare Tokens, therefore am comparing DoubleTokens and IntTokens here. If other kinds of Tokens are used, this Comparer needs to be extended.- Author:
- Jia Zou, Slobodan Matic, Patricia Derler
-
-
Constructor Summary
Constructors Constructor Description TagComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(java.lang.Object arg0, java.lang.Object arg1)
Compare two events according to time stamps and values.
-
-
-
Method Detail
-
compare
public int compare(java.lang.Object arg0, java.lang.Object arg1)
Compare two events according to time stamps and values. FIXME Because there is no general compare method for tokens, I implemented the comparison for int and double tokens. A more general compare is required.- Specified by:
compare
in interfacejava.util.Comparator
- Parameters:
arg0
- First event.arg1
- Second event.- Returns:
- -1 if event arg0 should be processed before event arg1, 0 if they should be processed at the same time, 1 if arg1 should be processed before arg0.
-
-