.useful Home Page

org.dotuseful.util
Class ArrayMgr

java.lang.Object
  extended byorg.dotuseful.util.ArrayMgr

public class ArrayMgr
extends java.lang.Object

This class contains various methods for manipulating arrays in addition to java.util.Arrays class.

Author:
dkrukovsky
See Also:
Arrays

Method Summary
static int indexOf(boolean[] source, boolean[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(byte[] source, byte[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(char[] source, char[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(double[] source, double[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(float[] source, float[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(int[] source, int[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(long[] source, long[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(java.lang.Object[] source, java.lang.Object[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
static int indexOf(short[] source, short[] target, int fromIndex)
          Returns the index within source array of the first occurrence of the target array, starting at the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

indexOf

public static int indexOf(boolean[] source,
                          boolean[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the boolean array being searched, and the target is the boolean array being searched for.

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(byte[] source,
                          byte[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the byte array being searched, and the target is the byte array being searched for.

Parameters:
source - the bytes being searched.
target - the bytes being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(char[] source,
                          char[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the char array being searched, and the target is the char array being searched for.

Parameters:
source - the chars being searched.
target - the chars being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(short[] source,
                          short[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the short array being searched, and the target is the short array being searched for.

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(int[] source,
                          int[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the int array being searched, and the target is the int array being searched for.

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(long[] source,
                          long[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the array of long being searched, and the target is the array of long being searched for.

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(float[] source,
                          float[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the float array being searched, and the target is the float array being searched for.

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(double[] source,
                          double[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the double array being searched, and the target is the double array being searched for.

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

indexOf

public static int indexOf(java.lang.Object[] source,
                          java.lang.Object[] target,
                          int fromIndex)
Returns the index within source array of the first occurrence of the target array, starting at the specified index. The source is the array of Object being searched, and the target is the array of Object being searched for. Two objects e1 and e2 are considered equal if (e1==null ? e2==null : e1.equals(e2)).

Parameters:
source - the array being searched.
target - the array being searched for.
fromIndex - the index to begin searching from.
Returns:
the index within source array of the first occurrence of the target array, starting at the specified index.

© 2004 .useful community

SourceForge.net-Logo