public final class Priority extends Object
Prioritized.getPriority()
,
Plugin.priority()
Modifier and Type | Field and Description |
---|---|
static double |
EXTREMELY_HIGH
Priority for items that very strongly prefer to be sorted early.
|
static double |
EXTREMELY_LOW
Priority for items that very strongly prefer to be sorted late.
|
static double |
FIRST
Priority for items that must be sorted first.
|
static double |
FIRST_PRIORITY
Deprecated.
Use
FIRST instead. |
static double |
HIGH
Priority for items that prefer to be sorted earlier.
|
static double |
HIGH_PRIORITY
Deprecated.
Use
HIGH instead. |
static double |
LAST
Priority for items that must be sorted last.
|
static double |
LAST_PRIORITY
Deprecated.
Use
LAST instead. |
static double |
LOW
Priority for items that prefer to be sorted later.
|
static double |
LOW_PRIORITY
Deprecated.
Use
LOW instead. |
static double |
NORMAL
Default priority for items.
|
static double |
NORMAL_PRIORITY
Deprecated.
Use
NORMAL instead. |
static double |
VERY_HIGH
Priority for items that strongly prefer to be sorted early.
|
static double |
VERY_HIGH_PRIORITY
Deprecated.
Use
VERY_HIGH instead. |
static double |
VERY_LOW
Priority for items that strongly prefer to be sorted late.
|
static double |
VERY_LOW_PRIORITY
Deprecated.
Use
VERY_LOW instead. |
Modifier and Type | Method and Description |
---|---|
static int |
compare(Prioritized p1,
Prioritized p2)
Compares two
Prioritized objects. |
static boolean |
inject(Object o,
double priority)
Injects the specified priority into the given object.
|
public static final double FIRST
Note that it is still possible to prioritize something earlier than this value (e.g., for testing purposes), although doing so strongly discouraged in production.
public static final double EXTREMELY_HIGH
public static final double VERY_HIGH
public static final double HIGH
public static final double NORMAL
public static final double LOW
public static final double VERY_LOW
public static final double EXTREMELY_LOW
public static final double LAST
Note that it is still possible to prioritize something later than this value (e.g., for testing purposes), although doing so strongly discouraged in production.
@Deprecated public static final double FIRST_PRIORITY
FIRST
instead.@Deprecated public static final double VERY_HIGH_PRIORITY
VERY_HIGH
instead.@Deprecated public static final double HIGH_PRIORITY
HIGH
instead.@Deprecated public static final double NORMAL_PRIORITY
NORMAL
instead.@Deprecated public static final double LOW_PRIORITY
LOW
instead.@Deprecated public static final double VERY_LOW_PRIORITY
VERY_LOW
instead.@Deprecated public static final double LAST_PRIORITY
LAST
instead.public static int compare(Prioritized p1, Prioritized p2)
Prioritized
objects.
Note: this method provides a natural ordering that may be inconsistent with
equals. That is, two unequal objects may often have the same priority, and
thus return 0 when compared in this fashion. Hence, if this method is used
as a basis for implementing Comparable.compareTo(T)
or
Comparator.compare(T, T)
, that implementation may want to
impose logic beyond that of this method, for breaking ties, if a total
ordering consistent with equals is always required.
p1
's priority is higher than p2
's, 1 if
p2
's priority is higher than p1
's, or 0 if they
have the same priority.ClassUtils.compare(Class, Class)
public static boolean inject(Object o, double priority)
Prioritized
interface.o
- The object to which the priority should be assigned.Copyright © 2015–2022 SciJava. All rights reserved.