net.ontopia.utils
Class ArrayUtils

java.lang.Object
  extended by net.ontopia.utils.ArrayUtils

public class ArrayUtils
extends java.lang.Object

INTERNAL: Class that contains useful array methods.


Field Summary
protected static java.util.Random random
           
 
Constructor Summary
ArrayUtils()
           
 
Method Summary
static int binarySearchFirst(java.lang.Object[] array, java.lang.Object o, java.util.Comparator c)
          INTERNAL: Performs a binary search and then returns the index of the first occurrence.
static boolean[] extend(boolean[] array, int extend_by)
           
static int[] extend(int[] array, int extend_by)
           
static java.lang.String[] extend(java.lang.String[] array, int extend_by)
           
static java.lang.Object getRandom(java.lang.Object[] array)
           
static java.lang.Object getRandom(java.lang.Object[] array, int offset)
           
static int indexOf(java.lang.String[] array, int size, java.lang.String key)
           
static int indexOf(java.lang.String[] array, java.lang.String key)
           
static java.lang.String[] slice(java.lang.String[] array, int index, int length)
           
static java.lang.String toString(boolean[] array)
           
static java.lang.String toString(byte[] array)
           
static java.lang.String toString(char[] array)
           
static java.lang.String toString(int[] array)
           
static java.lang.String toString(long[] array)
           
static java.lang.String toString(java.lang.Object[] array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

protected static final java.util.Random random
Constructor Detail

ArrayUtils

public ArrayUtils()
Method Detail

extend

public static java.lang.String[] extend(java.lang.String[] array,
                                        int extend_by)

extend

public static int[] extend(int[] array,
                           int extend_by)

extend

public static boolean[] extend(boolean[] array,
                               int extend_by)

indexOf

public static int indexOf(java.lang.String[] array,
                          java.lang.String key)

indexOf

public static int indexOf(java.lang.String[] array,
                          int size,
                          java.lang.String key)

slice

public static java.lang.String[] slice(java.lang.String[] array,
                                       int index,
                                       int length)

toString

public static java.lang.String toString(java.lang.Object[] array)

toString

public static java.lang.String toString(boolean[] array)

toString

public static java.lang.String toString(byte[] array)

toString

public static java.lang.String toString(char[] array)

toString

public static java.lang.String toString(int[] array)

toString

public static java.lang.String toString(long[] array)

getRandom

public static java.lang.Object getRandom(java.lang.Object[] array)

getRandom

public static java.lang.Object getRandom(java.lang.Object[] array,
                                         int offset)

binarySearchFirst

public static int binarySearchFirst(java.lang.Object[] array,
                                    java.lang.Object o,
                                    java.util.Comparator c)
INTERNAL: Performs a binary search and then returns the index of the first occurrence. Note that this method extends Arrays.binarySearch(Object[], Object, Comparator) by guaranteeing that it returns the first occurrence of the element.

Since:
4.0.5


Copyright © 2000-2012 Ontopia.