|
|||||||||
| 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 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 |
|---|
int compare(int index,
java.lang.Object key)
int compare(int index,
java.lang.Object key,
java.util.Comparator comp)
java.lang.Object keyAt(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 | ||||||||