public abstract class AbstractQueueSorterImpl extends QueueSorter implements Comparator<Queue.BuildableItem>
QueueSorter
in terms of Comparator
.ExtensionPoint.LegacyInstancesAreScopedToHudson
DEFAULT_BLOCKED_ITEM_COMPARATOR
Constructor and Description |
---|
AbstractQueueSorterImpl() |
Modifier and Type | Method and Description |
---|---|
protected static int |
compare(int a,
int b)
Deprecated.
Use Integer.compare instead.
sign(a-b).
|
protected static int |
compare(long a,
long b)
Deprecated.
Use Long.compare instead.
sign(a-b).
|
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.
|
all, installDefaultQueueSorter, sortBlockedItems
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public void sortBuildableItems(List<Queue.BuildableItem> buildables)
QueueSorter
sortBuildableItems
in class QueueSorter
buildables
- List of buildable items in the queue. Never null.public int compare(Queue.BuildableItem lhs, Queue.BuildableItem rhs)
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.
compare
in interface Comparator<Queue.BuildableItem>
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince(value="2.211") protected static int compare(long a, long b)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince(value="2.211") protected static int compare(int a, int b)
Copyright © 2004–2022. All rights reserved.