Package hudson.model.queue
Class AbstractQueueSorterImpl
- java.lang.Object
-
- hudson.model.queue.QueueSorter
-
- hudson.model.queue.AbstractQueueSorterImpl
-
- All Implemented Interfaces:
ExtensionPoint
,Comparator<Queue.BuildableItem>
public abstract class AbstractQueueSorterImpl extends QueueSorter implements Comparator<Queue.BuildableItem>
Partial implementation ofQueueSorter
in terms ofComparator
.- Since:
- 1.343
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.queue.QueueSorter
DEFAULT_BLOCKED_ITEM_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description AbstractQueueSorterImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static int
compare(int a, int b)
Deprecated.Use Integer.compare instead.protected static int
compare(long a, long b)
Deprecated.Use Long.compare instead.int
compare(Queue.BuildableItem lhs, Queue.BuildableItem rhs)
Override this method to provide the ordering of the sort.void
sortBuildableItems(List<Queue.BuildableItem> buildables)
Sorts the buildable items list.-
Methods inherited from class hudson.model.queue.QueueSorter
all, installDefaultQueueSorter, sortBlockedItems
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
sortBuildableItems
public void sortBuildableItems(List<Queue.BuildableItem> buildables)
Description copied from class:QueueSorter
Sorts the buildable items list. The items at the beginning will be executed before the items at the end of the list.- Specified by:
sortBuildableItems
in classQueueSorter
- Parameters:
buildables
- List of buildable items in the queue. Never null.
-
compare
public int compare(Queue.BuildableItem lhs, Queue.BuildableItem rhs)
Override this method to provide the ordering of the sort.if lhs should be build before rhs, return a negative value. Or put another way, think of the comparison as a process of converting a
Queue.BuildableItem
into a number, then doing num(lhs)-num(rhs).The default implementation does FIFO.
- Specified by:
compare
in interfaceComparator<Queue.BuildableItem>
-
compare
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.211") protected static int compare(long a, long b)
Deprecated.Use Long.compare instead. sign(a-b).
-
compare
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.211") protected static int compare(int a, int b)
Deprecated.Use Integer.compare instead. sign(a-b).
-
-