All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jdsl.core.api.Comparator

public interface Comparator
A comparator does comparisons of objects in the universe the comparator is defined over. A comparator throws an InvalidElementException if passed a null element, or an element outside of its universe.


Method Index

 o isComparable(Object)
Tests whether this comparator can compare this object
 o isEqualTo(Object, Object)
Tests equality of two objects in the universe over which this comparator is defined.
 o isGreaterThan(Object, Object)
Tests strict order of two objects in the universe over which this comparator is defined.
 o isGreaterThanOrEqualTo(Object, Object)
Tests non-strict order of two objects in the universe over which this comparator is defined.
 o isLessThan(Object, Object)
Tests strict order of two objects in the universe over which this comparator is defined.
 o isLessThanOrEqualTo(Object, Object)
Tests non-strict order of two objects in the universe over which this comparator is defined.

Methods

 o isEqualTo
 public abstract boolean isEqualTo(Object a,
                                   Object b) throws InvalidElementException
Tests equality of two objects in the universe over which this comparator is defined.

Returns:
whether a is equal to b
 o isGreaterThan
 public abstract boolean isGreaterThan(Object a,
                                       Object b) throws InvalidElementException
Tests strict order of two objects in the universe over which this comparator is defined.

Returns:
whether a is greater than b
 o isLessThan
 public abstract boolean isLessThan(Object a,
                                    Object b) throws InvalidElementException
Tests strict order of two objects in the universe over which this comparator is defined.

Returns:
whether a is less than b
 o isGreaterThanOrEqualTo
 public abstract boolean isGreaterThanOrEqualTo(Object a,
                                                Object b) throws InvalidElementException
Tests non-strict order of two objects in the universe over which this comparator is defined.

Returns:
whether a is greater than or equal to b
 o isLessThanOrEqualTo
 public abstract boolean isLessThanOrEqualTo(Object a,
                                             Object b) throws InvalidElementException
Tests non-strict order of two objects in the universe over which this comparator is defined.

Returns:
whether a is less than or equal to b
 o isComparable
 public abstract boolean isComparable(Object a)
Tests whether this comparator can compare this object

Returns:
whether a can be compared to other objects using this comparator

All Packages  Class Hierarchy  This Package  Previous  Next  Index