Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public int compare(CentralTask o1, CentralTask o2) {
- if (o1 instanceof DownloadJobEntryTask && o2 instanceof DownloadJobEntryTask)
- return Long.compare(o1.createTime, o2.createTime);
- else if (o1 instanceof DownloadJobEntryTask || o2 instanceof DownloadJobEntryTask) {
- return o1 instanceof DownloadJobEntryTask ? -1 : 1;
- }
- if (o1 instanceof DownloadCameraIntervalTask && o2 instanceof DownloadCameraIntervalTask) {
- DownloadCameraIntervalTask d1 = (DownloadCameraIntervalTask)o1;
- DownloadCameraIntervalTask d2 = (DownloadCameraIntervalTask)o2;
- if (d1.getPriority() == d2.getPriority())
- return Long.compare(d1.createTime, d2.createTime);
- else
- return d1.getPriority() < d2.getPriority() ? 1 : -1;
- } else if (o1 instanceof DownloadCameraIntervalTask || o2 instanceof DownloadCameraIntervalTask)
- return o1 instanceof DownloadCameraIntervalTask ? -1 : 1;
- return Long.compare(o1.createTime, o2.createTime);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement