SoftNet-Consult Java Utility Library

com.softnetConsult.utils.collections
Class ArrayTools

java.lang.Object
  extended by com.softnetConsult.utils.collections.ArrayTools

public final class ArrayTools
extends java.lang.Object

A collection of static utility functions for array processing.

This product includes software developed by the SoftNet-Consult Java Utility Library project and its contributors.
(http://java-tools.sourceforge.net)
Copyright (c) 2007-2008 SoftNet-Consult.
Copyright (c) 2007-2008 G. Paperin.
All rights reserved.

File: ArrayTools.java
Library API version: "2.02"
Java compliance version: "1.5"

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following terms and conditions are met:

1. Redistributions of source code must retain the above acknowledgement of the SoftNet-Consult Java Utility Library project, the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above acknowledgement of the SoftNet-Consult Java Utility Library project, the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software or any derived software must display the following acknowledgement:
This product includes software developed by the SoftNet-Consult Java Utility Library project and its contributors.

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version:
"2.02"
Author:
Greg Paperin (http://www.paperin.org)

Field Summary
static java.lang.String arrayClose
          Closing bracket when converting arrays to Strings.
static java.lang.String arrayOpen
          Opening bracket when converting arrays to Strings.
static java.lang.String defaultArraySeparator
          Default separator when converting arrays to Strings.
static java.lang.String nullName
          A String representing a null.
 
Constructor Summary
private ArrayTools()
          Prevents instances of this class from being created as this class contains only static utility methods.
 
Method Summary
static
<AET> java.lang.String
arrayToString(AET[] array)
          Converts the specified array to a string using ", " as delimeter.
static
<AET> java.lang.String
arrayToString(AET[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static
<AET> java.lang.String
arrayToString(AET[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators, "null" as null element indicator and the specified listSeparator} as element delimeter.
private static
<AET> java.lang.String
arrayToString(AET[] array, java.lang.String listSeparator, java.util.Set<java.lang.Object> seenSubarrays)
          This private method is used internally by arrayToString(Object[], String) and has an additional parameter used to keep track or recursively processed arrays in order to avoid infinite recursion.
static java.lang.String arrayToString(boolean[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(boolean[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(boolean[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(byte[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(byte[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(byte[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(char[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(char[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(char[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(double[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(double[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(double[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(float[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(float[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(float[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(int[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(int[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(int[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(long[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(long[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(long[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static java.lang.String arrayToString(java.lang.Object array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(java.lang.Object array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(java.lang.Object array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators, "null" as null element indicator and the specified listSeparator} as element delimeter.
private static java.lang.String arrayToString(java.lang.Object array, java.lang.String listSeparator, java.util.Set<java.lang.Object> seenSubarrays)
          This private method is used internally by arrayToString(Object, String) and has an additional parameter used to keep track or recursively processed arrays in order to avoid infinite recursion.
static java.lang.String arrayToString(short[] array)
          Converts the specified array to a string using ", " as delimeter.
static java.lang.String arrayToString(short[] array, char listSeparator)
          Converts the specified array to a string using the specified character as delimeter.
static java.lang.String arrayToString(short[] array, java.lang.String listSeparator)
          Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.
static
<ET,AET extends ET>
ArrayIterator<ET>
iterate(AET[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorBoolean iterate(boolean[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorByte iterate(byte[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorChar iterate(char[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorDouble iterate(double[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorFloat iterate(float[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorInt iterate(int[] array)
          Creates an array iterator over the specified array.
static ArrayIteratorLong iterate(long[] array)
          Creates an array iterator over the specified array.
static java.util.Iterator<?> iterate(java.lang.Object array)
          Creates an array iterator over the specified array.
static ArrayIteratorShort iterate(short[] array)
          Creates an array iterator over the specified array.
static java.lang.Boolean[] toWrapperArray(boolean[] arr)
          Converts an array of primitive boolean values to an array of Boolean objects wrapping the respective primitive values.
static java.lang.Byte[] toWrapperArray(byte[] arr)
          Converts an array of primitive byte values to an array of Byte objects wrapping the respective primitive values.
static java.lang.Character[] toWrapperArray(char[] arr)
          Converts an array of primitive char values to an array of Character objects wrapping the respective primitive values.
static java.lang.Double[] toWrapperArray(double[] arr)
          Converts an array of primitive double values to an array of Double objects wrapping the respective primitive values.
static java.lang.Float[] toWrapperArray(float[] arr)
          Converts an array of primitive float values to an array of Float objects wrapping the respective primitive values.
static java.lang.Integer[] toWrapperArray(int[] arr)
          Converts an array of primitive int values to an array of Integer objects wrapping the respective primitive values.
static java.lang.Long[] toWrapperArray(long[] arr)
          Converts an array of primitive long values to an array of Long objects wrapping the respective primitive values.
static java.lang.Object[] toWrapperArray(java.lang.Object arr)
          Converts an array of primitive values to an array of appropriate wrapper objects wrapping the respective primitive values.
static java.lang.Short[] toWrapperArray(short[] arr)
          Converts an array of primitive short values to an array of Short objects wrapping the respective primitive values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultArraySeparator

public static final java.lang.String defaultArraySeparator
Default separator when converting arrays to Strings.

See Also:
Constant Field Values

arrayOpen

public static final java.lang.String arrayOpen
Opening bracket when converting arrays to Strings.

See Also:
Constant Field Values

arrayClose

public static final java.lang.String arrayClose
Closing bracket when converting arrays to Strings.

See Also:
Constant Field Values

nullName

public static final java.lang.String nullName
A String representing a null.

See Also:
Constant Field Values
Constructor Detail

ArrayTools

private ArrayTools()
Prevents instances of this class from being created as this class contains only static utility methods.

Method Detail

iterate

public static <ET,AET extends ET> ArrayIterator<ET> iterate(AET[] array)
Creates an array iterator over the specified array.

Type Parameters:
ET - Type of iteration objects.
AET - Array elements' type.
Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorBoolean iterate(boolean[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorByte iterate(byte[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorChar iterate(char[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorShort iterate(short[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorInt iterate(int[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorLong iterate(long[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorFloat iterate(float[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static ArrayIteratorDouble iterate(double[] array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.

iterate

public static java.util.Iterator<?> iterate(java.lang.Object array)
Creates an array iterator over the specified array.

Parameters:
array - The array to iterate.
Returns:
An Iterator over the specified array.
Throws:
java.lang.NullPointerException - If the specified parameter is null.
java.lang.NullPointerException - If the specified parameter is not an array and not iterable.

arrayToString

public static <AET> java.lang.String arrayToString(AET[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Type Parameters:
AET - Type of the array's elements.
Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static <AET> java.lang.String arrayToString(AET[] array,
                                                   char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Type Parameters:
AET - Type of the array's elements.
Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static <AET> java.lang.String arrayToString(AET[] array,
                                                   java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators, "null" as null element indicator and the specified listSeparator} as element delimeter. For instance, arrayToString(new Integer[] {0, -5, null, 11}, "; ") will create the string "[0; -5; null, 11]".

Type Parameters:
AET - Type of the array's elements.
Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

private static <AET> java.lang.String arrayToString(AET[] array,
                                                    java.lang.String listSeparator,
                                                    java.util.Set<java.lang.Object> seenSubarrays)
This private method is used internally by arrayToString(Object[], String) and has an additional parameter used to keep track or recursively processed arrays in order to avoid infinite recursion.

Type Parameters:
AET - Type of the array's elements.
Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
seenSubarrays - Arrays already processed bythis recursion.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(java.lang.Object array)
Converts the specified array to a string using ", " as delimeter. If the specified parameter is not an array, a String representation of the parameter is returned. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(java.lang.Object array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. If the specified parameter is not an array, a String representation of the parameter is returned. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(java.lang.Object array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators, "null" as null element indicator and the specified listSeparator} as element delimeter. For instance, arrayToString(new Integer[] {0, -5, null, 11}, "; ") will create the string "[0; -5; null, 11]". If the specified parameter is not an array, a String representation of the parameter is returned.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specifoed array.

arrayToString

private static java.lang.String arrayToString(java.lang.Object array,
                                              java.lang.String listSeparator,
                                              java.util.Set<java.lang.Object> seenSubarrays)
This private method is used internally by arrayToString(Object, String) and has an additional parameter used to keep track or recursively processed arrays in order to avoid infinite recursion.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
seenSubarrays - Arrays already processed bythis recursion.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(boolean[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(boolean[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(boolean[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(byte[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(byte[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(byte[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(char[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(char[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(char[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(short[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(short[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(short[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(int[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(int[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(int[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(long[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(long[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(long[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(float[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(float[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(float[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

arrayToString

public static java.lang.String arrayToString(double[] array)
Converts the specified array to a string using ", " as delimeter. This is equivalent to arrayToString(array, ", ").

Parameters:
array - The array to converto to a string.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(double[] array,
                                             char listSeparator)
Converts the specified array to a string using the specified character as delimeter. This is equivalent to arrayToString(array, new String(new char[] {listSeparator})).

Parameters:
array - The array to converto to a string.
listSeparator - The values separator character.
Returns:
A string representation of the specifoed array.

arrayToString

public static java.lang.String arrayToString(double[] array,
                                             java.lang.String listSeparator)
Converts the specified array to a string using '[' and ']' as start and end indicators and the specified listSeparator} as element delimeter.

Parameters:
array - The array to convert to a string.
listSeparator - The values separator.
Returns:
A string representation of the specified array.

toWrapperArray

public static java.lang.Boolean[] toWrapperArray(boolean[] arr)
Converts an array of primitive boolean values to an array of Boolean objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Byte[] toWrapperArray(byte[] arr)
Converts an array of primitive byte values to an array of Byte objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Character[] toWrapperArray(char[] arr)
Converts an array of primitive char values to an array of Character objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Short[] toWrapperArray(short[] arr)
Converts an array of primitive short values to an array of Short objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Integer[] toWrapperArray(int[] arr)
Converts an array of primitive int values to an array of Integer objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Long[] toWrapperArray(long[] arr)
Converts an array of primitive long values to an array of Long objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Float[] toWrapperArray(float[] arr)
Converts an array of primitive float values to an array of Float objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Double[] toWrapperArray(double[] arr)
Converts an array of primitive double values to an array of Double objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.

toWrapperArray

public static java.lang.Object[] toWrapperArray(java.lang.Object arr)
Converts an array of primitive values to an array of appropriate wrapper objects wrapping the respective primitive values.

Parameters:
arr - An array.
Returns:
A corresponding array of wrapper objects or null if the specified array is null.
Throws:
java.lang.IllegalArgumentException - if the specified parameter if not an array or if it is an array of non-primitive elements.

SoftNet-Consult Java Utility Library is a member of SourceForge.net