public class ReverseComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>
Modifier and Type | Field and Description |
---|---|
protected java.util.Comparator<T> |
comparator |
static java.lang.String |
REVISION |
Constructor and Description |
---|
ReverseComparator()
Defaut constructor reverse NaturalComparator
Objects mus be Comparable
|
ReverseComparator(java.util.Comparator<T> comparator)
This constructor will reverse returned value
by given comparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2) |
java.util.Comparator<T> |
getReversedComparator()
Retrieve the Comparator this ReverseComparator is reversing
or null when the natural Comparator is reversed.
|
public static final java.lang.String REVISION
protected java.util.Comparator<T> comparator
public ReverseComparator()
public ReverseComparator(java.util.Comparator<T> comparator)
comparator
- used to compare objectpublic java.util.Comparator<T> getReversedComparator()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.