|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--drasys.or.alg.SequentialSearch
An implementation of a sequential search. Uses 'Object.equals()' for the default comparison. The compare object will be used for comparison if it is set.
References:
Introduction to Algorithms
Thomas H. Cormen, et al / Hardcover / Published 1990
Constructor Summary | |
SequentialSearch()
Uses 'Object.equals()' for the default comparison. |
|
SequentialSearch(CompareI compare)
Uses 'compare' for the comparison. |
Method Summary | |
int |
find(byte[] array,
byte key)
Returns the index of the first matching element. |
int |
find(byte[] array,
byte key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(double[] array,
double key)
Returns the index of the first matching element. |
int |
find(double[] array,
double key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(float[] array,
float key)
Returns the index of the first matching element. |
int |
find(float[] array,
float key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(int[] array,
int key)
Returns the index of the first matching element. |
int |
find(int[] array,
int key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(long[] array,
long key)
Returns the index of the first matching element. |
int |
find(long[] array,
long key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(java.lang.Object[] array,
java.lang.Object key)
Returns the index of the first matching element. |
int |
find(java.lang.Object[] array,
java.lang.Object key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(short[] array,
short key)
Returns the index of the first matching element. |
int |
find(short[] array,
short key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(java.lang.String[] array,
java.lang.String key)
Returns the index of the first matching element. |
int |
find(java.lang.String[] array,
java.lang.String key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(VectorI vector,
double key)
Returns the index of the first matching element. |
int |
find(VectorI vector,
double key,
int from,
int to)
Returns the index of the first matching element in the block. |
int |
find(java.util.Vector vector,
java.lang.Object key)
Returns the index of the first matching element. |
int |
find(java.util.Vector vector,
java.lang.Object key,
int from,
int to)
Returns the index of the first matching element in the block. |
CompareI |
getCompare()
Gets the comparison object. |
int |
insertionIndex()
If a find fails, this returns the index where the new element should be inserted. |
void |
setCompare(CompareI compare)
Sets the comparison object. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SequentialSearch()
public SequentialSearch(CompareI compare)
Method Detail |
public void setCompare(CompareI compare)
public CompareI getCompare()
public int insertionIndex()
public int find(java.lang.Object[] array, java.lang.Object key)
public int find(java.lang.Object[] array, java.lang.Object key, int from, int to)
public int find(java.util.Vector vector, java.lang.Object key)
public int find(java.util.Vector vector, java.lang.Object key, int from, int to)
public int find(int[] array, int key)
public int find(int[] array, int key, int from, int to)
public int find(short[] array, short key)
public int find(short[] array, short key, int from, int to)
public int find(byte[] array, byte key)
public int find(byte[] array, byte key, int from, int to)
public int find(double[] array, double key)
public int find(double[] array, double key, int from, int to)
public int find(float[] array, float key)
public int find(float[] array, float key, int from, int to)
public int find(long[] array, long key)
public int find(long[] array, long key, int from, int to)
public int find(java.lang.String[] array, java.lang.String key)
public int find(java.lang.String[] array, java.lang.String key, int from, int to)
public int find(VectorI vector, double key)
public int find(VectorI vector, double key, int from, int to)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |