|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.util.ArraysUtil
public final class ArraysUtil
This class contains a static factory that allows arrays to be viewed as lists.
| Method Summary | |
|---|---|
static String |
toString(boolean[] array)
Returns a string representation of the contents of the specified array. |
static String |
toString(byte[] array)
Returns a string representation of the contents of the specified array. |
static String |
toString(char[] array)
Returns a string representation of the contents of the specified array. |
static String |
toString(int[] array)
Returns a string representation of the contents of the specified array. |
static String |
toString(long[] array)
Returns a string representation of the contents of the specified array. |
static String |
toString(Object array)
Returns a string representation of the contents of given object with special care for potential arrays. |
static String |
toString(Object[] array)
Returns a string representation of the contents of the specified array. |
static String |
toString(Object[] array,
int maxSize)
Returns a string representation of the contents of the specified array with a maxSize limitation. |
static String |
toString(Object array,
int maxSize)
Returns a string representation of the contents of given object with special care for potential arrays, the output is cut - for each potentially contained array - to maxSize. |
static String |
toString(short[] array)
Returns a string representation of the contents of the specified array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String toString(Object array)
The value returned by this method is equal to the value that would be returned by Arrays.asList(a).toString(), unless array is null, in which case "null" is returned.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering( CLASSNAME, "foo(Object[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(Object array,
int maxSize)
If one of the contained arrays contains more than maxSize elements, the dump is stopped and the number of total elements is printed in the output, for the particular array.
array - The array whose string representation to return.maxSize - the maximum number of elements to print, will
be ignored if set to 0 or below.
toString(Object)public static String toString(Object[] array)
Object.toString()method inherited
from Object, which describes their identities
rather than their contents.
The value returned by this method is equal to the value that would be returned by Arrays.asList(a).toString(), unless array is null, in which case "null" is returned.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(Object[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(Object[] array,
int maxSize)
The value returned by this method is equal to the value that would be returned by Arrays.asList(a).toString(), unless array is null, in which case "null" is returned.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(Object[])", ArraysUtil.toString(array));
array - The array whose string representation to return.maxSize - the maximum number of elements to print, will
be ignored if set to 0 or below.
public static String toString(int[] array)
The value dumps all int stored in the given array.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(int[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(short[] array)
The value dumps all short stored in the given array.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(short[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(long[] array)
The value dumps all long stored in the given array.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(long[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(byte[] array)
The value dumps all byte values stored in the given array.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(byte[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(char[] array)
The value dumps all char values stored in the given array.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(char[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
public static String toString(boolean[] array)
The value dumps all boolean values stored in the given array.
This method is useful to dump the content of the array in a tracing method, e.g.:
logger.entering(
CLASSNAME, "foo(boolean[])", ArraysUtil.toString(array));
array - The array whose string representation to return.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||