org.apache.myfaces.commons.util
Class ArrayUtils

java.lang.Object
  extended by org.apache.myfaces.commons.util.ArrayUtils

public final class ArrayUtils
extends Object

Utility class for managing arrays

Since:
1.0.1
Version:
$Revision: 557350 $ $Date: 2007-07-18 13:19:50 -0500 (miƩ, 18 jul 2007) $
Author:
Anton Koinov (latest modification by $Author: matzew $)

Field Summary
static Object[] EMPTY_OBJECT_ARRAY
           
static String[] EMPTY_STRING_ARRAY
           
 
Constructor Summary
protected ArrayUtils()
           
 
Method Summary
static Object concat(Object[] arrs)
          Concatenates arrays into one.
static Object concat(Object toArray, int totalLen, Object[] arrs)
           
static Object concat(Object arr1, Object arr2)
          Concatenates two arrays into one.
static Object concat(Object arr1, Object arr2, Object arr3)
           
static Object concat(Object arr1, Object arr2, Object arr3, Object arr4)
           
static Object concat(Object arr1, Object arr2, Object arr3, Object arr4, Object arr5)
           
static Object concatSameType(Object toArray, Object[] arrs)
           
static boolean contains(Object[] array, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_OBJECT_ARRAY

public static final Object[] EMPTY_OBJECT_ARRAY

EMPTY_STRING_ARRAY

public static final String[] EMPTY_STRING_ARRAY
Constructor Detail

ArrayUtils

protected ArrayUtils()
Method Detail

concat

public static Object concat(Object arr1,
                            Object arr2)
Concatenates two arrays into one. If arr1 is null or empty, returns arr2. If arr2 is null or empty, returns arr1. May return null if both arrays are null, or one is empty and the other null.
The concatenated array has componentType which is compatible with both input arrays (or Object[])

Parameters:
arr1 - input array
arr2 - input array
Returns:
Object the concatenated array, elements of arr1 first

concat

public static Object concat(Object[] arrs)
Concatenates arrays into one. Any null or empty arrays are ignored. If all arrays are null or empty, returns null. Elements will be ordered in the order in which the arrays are supplied.

Parameters:
arrs - array of arrays
Returns:
the concatenated array

concat

public static Object concat(Object toArray,
                            int totalLen,
                            Object[] arrs)

concat

public static Object concat(Object arr1,
                            Object arr2,
                            Object arr3)

concat

public static Object concat(Object arr1,
                            Object arr2,
                            Object arr3,
                            Object arr4)

concat

public static Object concat(Object arr1,
                            Object arr2,
                            Object arr3,
                            Object arr4,
                            Object arr5)

concatSameType

public static Object concatSameType(Object toArray,
                                    Object[] arrs)

contains

public static boolean contains(Object[] array,
                               Object value)


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.