All Packages Class Hierarchy This Package Previous Next Index
Interface benno.sort.Ordering
- public interface Ordering
An implementation of this interface represents an ordering of Objects.
The ordering does not have to be defined between all pairs of objects.
If an ordering is not defined between two objects, an exception should be
thrown.
For example, an IntegerOrdering cannot compare an Integer with a
GridBagLayout.
The = is used for ordering, not testing for equality, and merely means that
the two objects occupy the same place in the ordering - it does not imply
that they are equal.
For example, an ordering by magnitude should say the -5 = 5, even though
-5 != 5.
It should also say that two Integer objects are equal if their stored value
is equal, not if they are the same object.
- Version:
- $Revision: 1.4 $
-
compare(Object, Object)
- This function should order a and b.
compare
public abstract int compare(Object a,
Object b)
- This function should order a and b. It should return:
-1 if a is before b
0 if a is ranked equally to b
1 if a is greater than b
All Packages Class Hierarchy This Package Previous Next Index