diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
| commit | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch) | |
| tree | 5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/utils/GTimeStampComparator.java | |
| parent | 036cbdba66f804743c4c838ed598d6972c4b3e17 (diff) | |
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better
Rewrote RemoteMap to use TreeMap instead of the internal array for
order. It now sorts its keys by number if they parse, else as strings.
Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/utils/GTimeStampComparator.java')
| -rw-r--r--[-rwxr-xr-x] | source/com/c2kernel/utils/GTimeStampComparator.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/com/c2kernel/utils/GTimeStampComparator.java b/source/com/c2kernel/utils/GTimeStampComparator.java index f57f20d..3680a50 100755..100644 --- a/source/com/c2kernel/utils/GTimeStampComparator.java +++ b/source/com/c2kernel/utils/GTimeStampComparator.java @@ -4,23 +4,24 @@ import java.util.Comparator; import com.c2kernel.common.GTimeStamp;
-public class GTimeStampComparator implements Comparator {
+public class GTimeStampComparator implements Comparator<Object> {
+ @Override
public int compare(Object arg0, Object arg1) {
GTimeStamp t0 = (GTimeStamp)arg0;
GTimeStamp t1 = (GTimeStamp)arg1;
-
+
int retVal = compareInt(t0.mYear, t1.mYear);
if (retVal == 0) retVal = compareInt(t0.mMonth, t1.mMonth);
if (retVal == 0) retVal = compareInt(t0.mDay, t1.mDay);
if (retVal == 0) retVal = compareInt(t0.mHour-(t0.mTimeOffset/3600), t1.mHour-(t1.mTimeOffset/3600));
if (retVal == 0) retVal = compareInt(t0.mMinute, t1.mMinute);
if (retVal == 0) retVal = compareInt(t0.mSecond, t1.mSecond);
-
+
return retVal;
}
- private int compareInt(int i, int j) {
+ private static int compareInt(int i, int j) {
return i-j;
}
}
|
