Class PriorityComparator<T>

java.lang.Object
net.sf.basedb.util.PriorityComparator<T>
All Implemented Interfaces:
Comparator<T>

public class PriorityComparator<T> extends Object implements Comparator<T>
A comparator implemenation that sorts a given set of objects before all other object.
Since:
2.17
Author:
Nicklas
Last modified
$Date: 2011-02-16 14:49:40 +0100 (on, 16 feb 2011) $
  • Field Details

  • Constructor Details

    • PriorityComparator

      public PriorityComparator(Collection<T> priority, Comparator<? super T> parent)
      Create a new comparator.
      Parameters:
      priority - A collection containing the objects that should be sorted first
      parent - The parent comparator used to sort the objects
    • PriorityComparator

      public PriorityComparator(SortedSet<T> priority)
      Create a new comparator using the same sort order as the given sorted set.
      Parameters:
      priority - A collection containing the objects that should be sorted first
  • Method Details