org.jbpm.util
Class ArrayUtil

java.lang.Object
  extended by org.jbpm.util.ArrayUtil

public class ArrayUtil
extends java.lang.Object

Various methods for manipulating arrays.


Method Summary
static boolean contains(java.lang.Object[] a, java.lang.Object o)
          Tells whether the given array contains the specified element.
static int indexOf(java.lang.Object[] a, java.lang.Object o)
          Returns the index in the given array of the first occurrence of the specified element, or -1 if the array does not contain this element.
static java.lang.String toString(long[] a)
          Returns a string representation of the contents of the specified array.
static java.lang.String toString(java.lang.Object[] a)
          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

toString

public static java.lang.String toString(java.lang.Object[] a)
Returns a string representation of the contents of the specified array. If the array contains other arrays as elements, they are converted to strings by the 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 the array is null, in which case "null" is returned.

Parameters:
a - the array whose string representation to return
Returns:
a string representation of a
See Also:
java.util.Arrays.toString(Object[])

toString

public static java.lang.String toString(long[] a)
Returns a string representation of the contents of the specified array. The string representation consists of a list of the array's elements, enclosed in square brackets ( "[]"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Elements are converted to strings by String.valueOf(long). Returns "null" if the array is null.

Parameters:
a - the array whose string representation to return
Returns:
a string representation of a
See Also:
java.util.Arrays.toString(long[])

indexOf

public static int indexOf(java.lang.Object[] a,
                          java.lang.Object o)
Returns the index in the given array of the first occurrence of the specified element, or -1 if the array does not contain this element.

Parameters:
o - element to search for.
Returns:
the index of the first occurrence of the specified element, or -1 if the array does not contain this element.

contains

public static boolean contains(java.lang.Object[] a,
                               java.lang.Object o)
Tells whether the given array contains the specified element.

Parameters:
o - element whose presence in the array is to be tested.
Returns:
true if the array contains the specified element.


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.