com.partnersoft.v3x.data
Interface ArraySortingGopher

All Known Implementing Classes:
InMemoryFindItemDump, InMemoryGoedelIndex, InMemoryStringIndex, ObjectDumpSortingGopher, PairArray

public interface ArraySortingGopher

A gopher for sorting algorithms is an pluggable adapter that adapts a generic array sorting algorithm to a specific data structure. This interface defines the typical actions required (comparison and swapping, mostly).


Method Summary
 int compare(int index, java.lang.Object key)
          Compares the key of the item at the given index using the key given, based on the default ordering.
 int compare(int index, java.lang.Object key, java.util.Comparator comp)
          Compares the key of the item at the given index using the key and ordering given.
 int getSize()
          Returns the number of items in the array.
 java.lang.Object keyAt(int index)
          Gets the key object from the given index.
 void swap(int a, int b)
          Swaps the items at the two index positions.
 

Method Detail

compare

int compare(int index,
            java.lang.Object key)
Compares the key of the item at the given index using the key given, based on the default ordering.


compare

int compare(int index,
            java.lang.Object key,
            java.util.Comparator comp)
Compares the key of the item at the given index using the key and ordering given.


keyAt

java.lang.Object keyAt(int index)
Gets the key object from the given index.


getSize

int getSize()
Returns the number of items in the array.


swap

void swap(int a,
          int b)
Swaps the items at the two index positions.