All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface edu.vt.marian.common.Sortable

public interface Sortable
A quicksort object which can be used to sort the elements of an enumeration in either non-increasing or non-decreasing order. The only requirement is that each element of the object being sorted implements the Sortable interface. Basically, this means an object provides a compare() method which can be used to determine whether one object is less than, equal to, or greater than another object.


Variable Index

 o DECREASING
Indicate that we want to sort in non-increasig order
 o EQUAL
Magic number to indicate object being compared against us is equal to our value
 o GREATER
Magic number to indicate object being compared against us is greater than our value
 o INCOMPARABLE
Magic number to indicate object being compared against us is incomparable to us.
 o INCREASING
Indicate that we want to sort in non-decreasing order
 o LESS
Magic number to indicate object being compared against us is less than our value

Method Index

 o compare(Object)
Compare an object with ourselves and return an int indicating how it compares relative to us.

Variables

 o INCREASING
 public static final int INCREASING
Indicate that we want to sort in non-decreasing order

 o DECREASING
 public static final int DECREASING
Indicate that we want to sort in non-increasig order

 o LESS
 public static final int LESS
Magic number to indicate object being compared against us is less than our value

 o EQUAL
 public static final int EQUAL
Magic number to indicate object being compared against us is equal to our value

 o GREATER
 public static final int GREATER
Magic number to indicate object being compared against us is greater than our value

 o INCOMPARABLE
 public static final int INCOMPARABLE
Magic number to indicate object being compared against us is incomparable to us.

Methods

 o compare
 public abstract int compare(Object obj)
Compare an object with ourselves and return an int indicating how it compares relative to us. The int is returned as follows:

All Packages  Class Hierarchy  This Package  Previous  Next  Index