public class PriorityComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>
Modifier and Type | Field and Description |
---|---|
private java.util.Comparator<? super T> |
parent |
private java.util.Collection<T> |
priority |
Constructor and Description |
---|
PriorityComparator(java.util.Collection<T> priority,
java.util.Comparator<? super T> parent)
Create a new comparator.
|
PriorityComparator(java.util.SortedSet<T> priority)
Create a new comparator using the same sort order as the given
sorted set.
|
private final java.util.Collection<T> priority
private final java.util.Comparator<? super T> parent
public PriorityComparator(java.util.Collection<T> priority, java.util.Comparator<? super T> parent)
priority
- A collection containing the objects that should be
sorted firstparent
- The parent comparator used to sort the objectspublic PriorityComparator(java.util.SortedSet<T> priority)
priority
- A collection containing the objects that should be
sorted first