PeriodicSample comparisons
tanmatra opened this issue · 1 comments
tanmatra commented
If stamp
marks end of period, should it be minus operator here, not plus?
But I may be wrong.
iris/src/us/mn/state/dot/tms/server/PeriodicSample.java
Lines 46 to 50 in 93ef16f
And by the way, you can use Long.compare()
method.
DougLau commented
The purpose of this compareTo is for ordering in PeriodicSampleCache:
iris/src/us/mn/state/dot/tms/server/PeriodicSampleCache.java
Lines 133 to 136 in 93ef16f
Here, periodMillis is guaranteed to be the same between all samples. In short, I don't think adding or subtracting makes any difference. If I was writing this code now, I would use a dedicated Comparator instead of natural ordering.