com.partnersoft.data
Interface ArraySearchingGopher


public interface ArraySearchingGopher

A gopher for searching algorithms is an pluggable adapter that adapts a generic array searching algorithm to a specific data structure. This interface defines the minimum actions required by searching 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 searching 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(java.lang.Object key)
          Remembers the given key for future comparisons.
 

Method Detail

remember

void remember(java.lang.Object key)
Remembers the given key 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.