@groovy.transform.CompileStatic abstract class GrailsArrayUtils extends java.lang.Object
Utility methods for working with Arrays
Constructor and description |
---|
GrailsArrayUtils
() |
Type Params | Return Type | Name and description |
---|---|---|
|
static java.lang.Object |
add(java.lang.Object array, int pos, java.lang.Object newObject) Adds the given object to the given array at the given position |
|
static java.lang.Object |
addAll(java.lang.Object array, java.lang.Object otherArray) Adds the given object to the given array at the given position |
|
static java.lang.Object |
addToEnd(java.lang.Object array, java.lang.Object newObject) Adds the given object to the end of the array returning a new array |
|
static java.lang.Object |
addToStart(java.lang.Object array, java.lang.Object newObject) Adds the given object to the start of the array returning a new array |
|
static boolean |
contains(java.lang.Object[] array, java.lang.Object elementToSearchFor) |
|
static java.lang.Object |
subarray(java.lang.Object args, int start, int end) Returns the subarray of an existing array |
|
static java.lang.String |
toString(java.lang.Object[] array) |
|
static java.lang.String |
toString(int[] array) |
|
static java.lang.String |
toString(boolean[] array) |
|
static java.lang.String |
toString(float[] array) |
|
static java.lang.String |
toString(short[] array) |
|
static java.lang.String |
toString(byte[] array) |
|
static java.lang.String |
toString(char[] array) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Adds the given object to the given array at the given position
array
- The arraypos
- The positionnewObject
- The objectAdds the given object to the given array at the given position
array
- The arraypos
- The positionnewObject
- The objectAdds the given object to the end of the array returning a new array
array
- The arraynewObject
- The objectAdds the given object to the start of the array returning a new array
array
- The arraynewObject
- The objectReturns the subarray of an existing array
args
- The array objectstart
- The start index (inclusive)end
- The end index (exclusive)