com.aliasi.util
Class FilterComparator<E>

java.lang.Object
  extended by com.aliasi.util.FilterComparator<E>
Type Parameters:
E - the type of objects being compared
All Implemented Interfaces:
Comparator<E>
Direct Known Subclasses:
ReversibleComparator

Deprecated. Build your own from scratch, this is a very simple filter.

@Deprecated
public class FilterComparator<E>
extends Object
implements Comparator<E>

Provides a generic filter for comparators, holding a reference to a contained comparator and allowing it to be retrieved, and a comparison operation that delegates to the contained comparator.

Since:
LingPipe1.0
Version:
3.0
Author:
Bob Carpenter

Field Summary
protected  Comparator<? super E> mComparator
          Deprecated. The comparator being filtered.
 
Constructor Summary
FilterComparator(Comparator<? super E> comparator)
          Deprecated. Construct a filter comparator containing the specified comparator and delegating comparison to it.
 
Method Summary
 int compare(E x1, E x2)
          Deprecated. Return the result of comparing the specified objects using the contained comparator.
 Comparator<? super E> getFilteredComparator()
          Deprecated. Returns the comparator being filtered, as provided to the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

mComparator

protected final Comparator<? super E> mComparator
Deprecated. 
The comparator being filtered.

Constructor Detail

FilterComparator

public FilterComparator(Comparator<? super E> comparator)
Deprecated. 
Construct a filter comparator containing the specified comparator and delegating comparison to it.

Parameters:
comparator - The comparator being filtered.
Method Detail

getFilteredComparator

public Comparator<? super E> getFilteredComparator()
Deprecated. 
Returns the comparator being filtered, as provided to the constructor.

Returns:
The comparator being filtered, as provided to the constructor.

compare

public int compare(E x1,
                   E x2)
Deprecated. 
Return the result of comparing the specified objects using the contained comparator. Subclasses typically override this implementation.

Specified by:
compare in interface Comparator<E>
Parameters:
x1 - First object to compare.
x2 - Second object to compare.
Returns:
A positive integer if the first object is greater than the second, a negative integer if the second is greater than the first, and zero if they are the same.