org.apache.jackrabbit.mk.util
Class ArrayUtils

java.lang.Object
  extended by org.apache.jackrabbit.mk.util.ArrayUtils

public class ArrayUtils
extends Object

Array utility methods.


Field Summary
static int[] EMPTY_INTEGER_ARRAY
           
static long[] EMPTY_LONG_ARRAY
           
static String[] EMPTY_STRING_ARRAY
           
 
Constructor Summary
ArrayUtils()
           
 
Method Summary
static int[] arrayInsert(int[] values, int index, int x)
          Insert an element into a clone of the array at the given position.
static long[] arrayInsert(long[] values, int index, long x)
          Insert an element into a clone of the array at the given position.
static String[] arrayInsert(String[] values, int index, String x)
          Insert an element into a clone of the array at the given position.
static
<T> T[]
arrayInsert(T[] values, int index, T x)
          Insert an element into a clone of the array at the given position.
static int[] arrayRemove(int[] values, int index)
          Remove an element from a clone of the array at the given position.
static long[] arrayRemove(long[] values, int index)
          Remove an element from a clone of the array at the given position.
static String[] arrayRemove(String[] values, int index)
          Remove an element from a clone of the array at the given position.
static
<T> T[]
arrayRemove(T[] values, int index)
          Remove an element from a clone of the array at the given position.
static
<T> T[]
arrayReplace(T[] values, int index, T x)
          Replace an element in a clone of the array at the given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STRING_ARRAY

public static final String[] EMPTY_STRING_ARRAY

EMPTY_LONG_ARRAY

public static final long[] EMPTY_LONG_ARRAY

EMPTY_INTEGER_ARRAY

public static final int[] EMPTY_INTEGER_ARRAY
Constructor Detail

ArrayUtils

public ArrayUtils()
Method Detail

arrayReplace

public static <T> T[] arrayReplace(T[] values,
                                   int index,
                                   T x)
Replace an element in a clone of the array at the given position.

Parameters:
values - the values
index - the index
x - the value to add
Returns:
the new array

arrayInsert

public static int[] arrayInsert(int[] values,
                                int index,
                                int x)
Insert an element into a clone of the array at the given position.

Parameters:
values - the values
index - the index
x - the value to add
Returns:
the new array

arrayInsert

public static long[] arrayInsert(long[] values,
                                 int index,
                                 long x)
Insert an element into a clone of the array at the given position.

Parameters:
values - the values
index - the index
x - the value to add
Returns:
the new array

arrayInsert

public static <T> T[] arrayInsert(T[] values,
                                  int index,
                                  T x)
Insert an element into a clone of the array at the given position.

Parameters:
values - the values
index - the index
x - the value to add
Returns:
the new array

arrayInsert

public static String[] arrayInsert(String[] values,
                                   int index,
                                   String x)
Insert an element into a clone of the array at the given position.

Parameters:
values - the values
index - the index
x - the value to add
Returns:
the new array

arrayRemove

public static int[] arrayRemove(int[] values,
                                int index)
Remove an element from a clone of the array at the given position.

Parameters:
values - the values
index - the index
Returns:
the new array

arrayRemove

public static <T> T[] arrayRemove(T[] values,
                                  int index)
Remove an element from a clone of the array at the given position.

Parameters:
values - the values
index - the index
Returns:
the new array

arrayRemove

public static long[] arrayRemove(long[] values,
                                 int index)
Remove an element from a clone of the array at the given position.

Parameters:
values - the values
index - the index
Returns:
the new array

arrayRemove

public static String[] arrayRemove(String[] values,
                                   int index)
Remove an element from a clone of the array at the given position.

Parameters:
values - the values
index - the index
Returns:
the new array


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.