org.jutil.java.collections
Class ExtendedComparator

java.lang.Object
  |
  +--org.jutil.java.collections.ExtendedComparator
All Implemented Interfaces:
java.util.Comparator
Direct Known Subclasses:
ComparableComparator, InverseComparator

public abstract class ExtendedComparator
extends java.lang.Object
implements java.util.Comparator

DEPRECATED

A Comparator with more convenient methods than java.util.Comparator.


Field Summary
static java.lang.String CVS_REVISION
          Deprecated.  
 
Constructor Summary
ExtendedComparator()
          Deprecated.  
 
Method Summary
static ExtendedComparator ensureExtended(java.util.Comparator comparator)
          Deprecated. Ensure that the result is an ExtendedComparator.
 boolean greater(java.lang.Object first, java.lang.Object second)
          Deprecated. Check whether or not the first object is greater than the second one.
 java.lang.Object max(java.lang.Object first, java.lang.Object second)
          Deprecated. Return the maximum of both objects.
 java.lang.Object min(java.lang.Object first, java.lang.Object second)
          Deprecated. Return the minimum of both objects.
 boolean notGreater(java.lang.Object first, java.lang.Object second)
          Deprecated. Check whether or not the first object is smaller than or equal to the second one.
 boolean notSmaller(java.lang.Object first, java.lang.Object second)
          Deprecated. Check whether or not the first object is greater than or equal to the second one.
 boolean smaller(java.lang.Object first, java.lang.Object second)
          Deprecated. Check whether or not the first object is smaller than the second one.
 
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
compare, equals
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Deprecated. 
Constructor Detail

ExtendedComparator

public ExtendedComparator()
Deprecated. 
Method Detail

max

public java.lang.Object max(java.lang.Object first,
                            java.lang.Object second)
Deprecated. 

Return the maximum of both objects. In case of a tie, any one of both can be returned.

Parameters:
first - The first object
second - The second object

Specifications:
public behavior
ensures \result == first|\result == second;
ensures compare(\result ,first) >= 0;
ensures compare(\result ,second) >= 0;

min

public java.lang.Object min(java.lang.Object first,
                            java.lang.Object second)
Deprecated. 

Return the minimum of both objects. In case of a tie, any one of both can be returned.

Parameters:
first - The first object
second - The second object

Specifications:
public behavior
ensures \result == first|\result == second;
ensures compare(\result ,first) <= 0;
ensures compare(\result ,second) <= 0;

greater

public boolean greater(java.lang.Object first,
                       java.lang.Object second)
Deprecated. 

Check whether or not the first object is greater than the second one.

Parameters:
first - The first object
second - The second object

Specifications:
public behavior
ensures \result == (compare(first,second) > 0);

smaller

public boolean smaller(java.lang.Object first,
                       java.lang.Object second)
Deprecated. 

Check whether or not the first object is smaller than the second one.

Parameters:
first - The first object
second - The second object

Specifications:
public behavior
ensures \result == (compare(first,second) < 0);

notSmaller

public boolean notSmaller(java.lang.Object first,
                          java.lang.Object second)
Deprecated. 

Check whether or not the first object is greater than or equal to the second one.

Parameters:
first - The first object
second - The second object

Specifications:
public behavior
ensures \result == !smaller(first,second);

notGreater

public boolean notGreater(java.lang.Object first,
                          java.lang.Object second)
Deprecated. 

Check whether or not the first object is smaller than or equal to the second one.

Parameters:
first - The first object
second - The second object

Specifications:
public behavior
ensures \result == !greater(first,second);

ensureExtended

public static ExtendedComparator ensureExtended(java.util.Comparator comparator)
Deprecated. 
Ensure that the result is an ExtendedComparator. If the given Comparator is not an ExtendedComparator, it will be wrapped.

Parameters:
comparator - The comparator of which one wants an ExtendedComparator that behaves the same.

Specifications:
public behavior
requires comparator != null;
ensures ( \forall Object o1; ; ( \forall Object o2; ; \result .compare(o1,o2) == comparator.compare(o1,o2)));