drasys.or.alg
Interface SearchI

All Known Implementing Classes:
SequentialSearch, BinarySearch

public interface SearchI

An interface used by algorithms to search arrays and vectors.


Method Summary
 int find(byte[] array, byte key)
          Returns the index of the matching element.
 int find(byte[] array, byte key, int from, int to)
          Returns the index of the matching element.
 int find(double[] array, double key)
          Returns the index of the matching element.
 int find(double[] array, double key, int from, int to)
          Returns the index of the matching element.
 int find(float[] array, float key)
          Returns the index of the matching element.
 int find(float[] array, float key, int from, int to)
          Returns the index of the matching element.
 int find(int[] array, int key)
          Returns the index of the matching element.
 int find(int[] array, int key, int from, int to)
          Returns the index of the matching element.
 int find(long[] array, long key)
          Returns the index of the matching element.
 int find(long[] array, long key, int from, int to)
          Returns the index of the matching element.
 int find(java.lang.Object[] array, java.lang.Object key)
          Returns the index of the matching element.
 int find(java.lang.Object[] array, java.lang.Object key, int from, int to)
          Returns the index of the matching element.
 int find(short[] array, short key)
          Returns the index of the matching element.
 int find(short[] array, short key, int from, int to)
          Returns the index of the matching element.
 int find(java.lang.String[] array, java.lang.String key)
          Returns the index of the matching element.
 int find(java.lang.String[] array, java.lang.String key, int from, int to)
          Returns the index of the matching element.
 int find(VectorI vector, double key)
          Returns the index of the matching element.
 int find(VectorI vector, double key, int from, int to)
          Returns the index of the matching element.
 int find(java.util.Vector vector, java.lang.Object key)
          Returns the index of the matching element.
 int find(java.util.Vector vector, java.lang.Object key, int from, int to)
          Returns the index of the matching element.
 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.
 

Method Detail

setCompare

public void setCompare(CompareI compare)
Sets the comparison object.

getCompare

public CompareI getCompare()
Gets the comparison object.

insertionIndex

public int insertionIndex()
If a find fails, this returns the index where the new element should be inserted.

find

public int find(java.util.Vector vector,
                java.lang.Object key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(java.util.Vector vector,
                java.lang.Object key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(VectorI vector,
                double key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(VectorI vector,
                double key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(java.lang.Object[] array,
                java.lang.Object key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(java.lang.Object[] array,
                java.lang.Object key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(int[] array,
                int key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(int[] array,
                int key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(byte[] array,
                byte key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(byte[] array,
                byte key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(short[] array,
                short key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(short[] array,
                short key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(long[] array,
                long key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(long[] array,
                long key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(double[] array,
                double key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(double[] array,
                double key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(float[] array,
                float key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(float[] array,
                float key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(java.lang.String[] array,
                java.lang.String key)
Returns the index of the matching element.
Returns:
-1 if the element is not found.

find

public int find(java.lang.String[] array,
                java.lang.String key,
                int from,
                int to)
Returns the index of the matching element.
Returns:
-1 if the element is not found.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com