|
@@ -24,6 +24,7 @@ package com.dmdirc.parser.irc.outputqueue;
|
24
|
24
|
|
25
|
25
|
import com.dmdirc.parser.common.QueuePriority;
|
26
|
26
|
import java.io.PrintWriter;
|
|
27
|
+import java.util.Comparator;
|
27
|
28
|
import java.util.concurrent.BlockingQueue;
|
28
|
29
|
|
29
|
30
|
/**
|
|
@@ -31,7 +32,7 @@ import java.util.concurrent.BlockingQueue;
|
31
|
32
|
*
|
32
|
33
|
* @author shane
|
33
|
34
|
*/
|
34
|
|
-public abstract class QueueHandler extends Thread {
|
|
35
|
+public abstract class QueueHandler extends Thread implements Comparator<QueueItem> {
|
35
|
36
|
/** Queue we are handling. */
|
36
|
37
|
protected final BlockingQueue<QueueItem> queue;
|
37
|
38
|
|
|
@@ -96,7 +97,7 @@ public abstract class QueueHandler extends Thread {
|
96
|
97
|
* @param otherObject Object we are comparing to.
|
97
|
98
|
* @return A QueueItem for teh given parameters
|
98
|
99
|
*/
|
99
|
|
- public int compareQueueItem(final QueueItem mainObject, final QueueItem otherObject) {
|
|
100
|
+ public int compare(final QueueItem mainObject, final QueueItem otherObject) {
|
100
|
101
|
if (mainObject.getTime() < 10 * 1000 && mainObject.getPriority().compareTo(otherObject.getPriority()) != 0) {
|
101
|
102
|
return mainObject.getPriority().compareTo(otherObject.getPriority());
|
102
|
103
|
}
|