com.partnersoft.data
Interface ArraySortingGopher

All Known Implementing Classes:
Compression.Chipmunk, InMemoryGoedelIndex, InMemoryStringIndex

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 minimum actions required by sorting algorithms. It is designed to be high-performance, so uses a memory register for compare-to values rather than some kind of object accessor. This allows higher speed for primitive sorting or complex keys.

Author:
Paul Reavis Copyright 2003 Partner Software, Inc.

Method Summary
 int compare(int index)
          Compares the key of the item at the given index with the current remembered key.
 int getSize()
          Returns the number of items in the array.
 void remember(int index)
          Remembers the key at the given index for future comparisons.
 void swap(int a, int b)
          Swaps the items at the two index positions.
 

Method Detail

remember

void remember(int index)
Remembers the key at the given index for future comparisons.


compare

int compare(int index)
Compares the key of the item at the given index with the current remembered key.


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.