laur.dm.ar
Class CriteriaSorter
java.lang.Object
|
+--laur.dm.ar.CriteriaSorter
- public class CriteriaSorter
- extends java.lang.Object
This class implements a method for sorting a List of
ComparableCriteria objects. It uses Collections.sort() so it
provides a stable sorting procedure.
Field Summary |
static int |
ASC
Specifies ascending order. |
static int |
DESC
Specifies descending order. |
Method Summary |
static void |
sort(java.util.List l,
int criteria,
int order)
Sort a List of ComparableCriteria objects according to criteria
criteria ad in the order specified by
order . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DESC
public static final int DESC
- Specifies descending order.
ASC
public static final int ASC
- Specifies ascending order.
CriteriaSorter
public CriteriaSorter()
sort
public static void sort(java.util.List l,
int criteria,
int order)
- Sort a List of ComparableCriteria objects according to criteria
criteria
ad in the order specified by
order
. Uses Collections.sort().
- Parameters:
l
- the List to be sortedcriteria
- the criteria based on which we will sort the
List elements, varies depending on the ComparableCriteria
implementation.order
- the order in which the sorting will be performed,
will be either ASC or DESC.