Back to project page Android-Fast-ImageLoader.
The source code is released under:
Apache License
If you think the Android project Android-Fast-ImageLoader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sunny.threadpool; // w ww . j ava 2 s. c o m public class AbstractCommand implements Comparable<AbstractCommand> { private boolean commandSortByLatest = true; int priority; long time; AbstractCommand(boolean commandSortByLatest) { this.commandSortByLatest = commandSortByLatest; this.time = System.currentTimeMillis(); } AbstractCommand(boolean commandSortByLatest, int priority) { this(commandSortByLatest); this.priority = priority; } @Override public int compareTo(AbstractCommand another) { int result = another.priority - priority; if (result == 0) { result = (int) (commandSortByLatest ? (another.time - time) : (time - another.time)); } return result; } }