Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.util
Class ArrayUtil

java.lang.Object
  extended by ch.randelshofer.util.ArrayUtil

public class ArrayUtil
extends java.lang.Object

This class contains various methods for manipulating arrays (such as sorting and searching).

Version:
5.0 2008-01-01 Removed methods which are in class Arrays.

Method Summary
static java.util.ArrayList asList(int[] values)
           
static void fill(byte[] data, byte value)
          Quickly fills an array with the specified value.
static int indexOf(java.lang.Object[] a, java.lang.Object o)
          Performs a linear search to determine the index of the specified Object.
static int max(int[] a)
          Returns the biggest integer value of the array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

max

public static int max(int[] a)
Returns the biggest integer value of the array.


indexOf

public static int indexOf(java.lang.Object[] a,
                          java.lang.Object o)
Performs a linear search to determine the index of the specified Object.

Parameters:
a - The array.
o - The object.
Returns:
The index of the object in the array, or -1 if the object is not contained in the array.

asList

public static java.util.ArrayList asList(int[] values)

fill

public static void fill(byte[] data,
                        byte value)
Quickly fills an array with the specified value. Faster than Arrays.fill!


Copyright 2012-02-25 Werner Randelshofer