|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.
| 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 |
|---|
void remember(int index)
int compare(int index)
int getSize()
void swap(int a,
int b)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||