org.wegra.util.collection.array
Class SequentialSearch

java.lang.Object
  extended byorg.wegra.util.collection.array.SequentialSearch

public class SequentialSearch
extends java.lang.Object

Sequential search.

Author:
wegra (Bok-yeon Lee)

Constructor Summary
SequentialSearch()
           
 
Method Summary
static int search(byte target, byte[] array)
          Finds a target element in a given array, and returns the index.
static int search(char target, char[] array)
          Finds a target element in a given array, and returns the index.
static int search(double target, double[] array)
          Finds a target element in a given array, and returns the index.
static int search(float target, float[] array)
          Finds a target element in a given array, and returns the index.
static int search(int target, int[] array)
          Finds a target element in a given array, and returns the index.
static int search(long target, long[] array)
          Finds a target element in a given array, and returns the index.
static int search(java.lang.Object target, java.lang.Object[] array, java.util.Comparator comp)
          Finds a target element in a given array, and returns the index.
static int search(short target, short[] array)
          Finds a target element in a given array, and returns the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialSearch

public SequentialSearch()
Method Detail

search

public static int search(java.lang.Object target,
                         java.lang.Object[] array,
                         java.util.Comparator comp)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(long target,
                         long[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(int target,
                         int[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(short target,
                         short[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(char target,
                         char[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(byte target,
                         byte[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(double target,
                         double[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.

search

public static int search(float target,
                         float[] array)
Finds a target element in a given array, and returns the index. It will return -1 if a given array does not contains a target.

Returns:
index of a target, if a given array doesn't contains it, it will return -1.