|
Groovy JDK | |||||||||
| Method Summary | |
|---|---|
Object
|
asType(Class clazz)
Converts the given array to either a List, Set, or SortedSet call is deferred to {link #asType(Object,Class)} |
boolean
|
equals(List right)
Determines if the contents of this array are equal to the contents of the given list, in the same order false if either collection is null
|
List
|
getAt(Collection indices)
Select a List of items from an Object array using a Collection to identify the indices to be selected |
List
|
getAt(Range range)
Support the range subscript operator for an Array |
List
|
getAt(IntRange range)
|
List
|
getAt(EmptyRange range)
|
List
|
getAt(ObjectRange range)
|
Object
|
inject(Object initialValue, Closure closure)
Iterates through the given array of objects, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure |
String
|
join(String separator)
Concatenates the toString() representation of each
items in this array, with the given String as a separator between each
item
|
Object
|
max()
Adds max() method to Object arrays |
Object
|
max(Closure closure)
Selects the maximum value found from the Object array using the given closure as a comparator number) for each item passed |
Object
|
max(Comparator comparator)
Selects the maximum value found from the Object array using the given comparator |
Object
|
min()
Adds min() method to Object arrays |
Object
|
min(Comparator comparator)
Selects the minimum value found from the Object array using the given comparator |
Object
|
min(Closure closure)
Selects the minimum value found from the Object array using the given closure as a comparator number) for each item passed |
Object[]
|
minus(Collection removeMe)
Create an array composed of the elements of the first array minus the elements of the given collection |
Object[]
|
minus(Object[] removeMe)
Create an array composed of the elements of the first array minus the elements of the given array |
Object[]
|
minus(Object operand)
Create a new object array composed of the elements of the first array minus the operand |
Object[]
|
reverse()
Reverse the items in an Object array |
Object[]
|
reverseEach(Closure closure)
Iterate over each element of the array in the reverse order |
int
|
size()
Provide the standard Groovy size() method for an array
|
Object[]
|
sort()
Sorts the given Object array into sorted order assumed to be comparable |
Object[]
|
sort(Comparator comparator)
Sorts the given Object array into sorted order using the given comparator |
Object[]
|
sort(Closure closure)
Sorts the given Object array into a newly created array using the given comparator |
String
|
toArrayString()
Returns the string representation of the given array displays the contents of the array, similar to an array literal, i {1, 2, "a"}
|
List
|
toList()
Allows conversion of arrays into a mutable List |
SpreadMap
|
toSpreadMap()
Creates a spreadable map from this array |
String
|
toString()
Returns the string representation of this array's contents |
| Method Detail |
|---|
public Object asType(Class clazz)
clazz - the desired class.
public boolean equals(List right)
false if either collection is null.
right - the list being compared.
public List getAt(Collection indices)
indices - a Collection of indices.
public List getAt(Range range)
range - a Range.
public List getAt(IntRange range)
public List getAt(EmptyRange range)
public List getAt(ObjectRange range)
public Object inject(Object initialValue, Closure closure)
initialValue - an initialValue.
closure - a closure.
public String join(String separator)
toString() representation of each
items in this array, with the given String as a separator between each
item.
separator - a String separator.
public Object max()
public Object max(Closure closure)
closure - a closure used as a comparator.
public Object max(Comparator comparator)
comparator - a Comparator.
public Object min()
public Object min(Comparator comparator)
comparator - a Comparator.
public Object min(Closure closure)
closure - a closure used as a comparator.
public Object[] minus(Collection removeMe)
removeMe - a Collection of elements to remove.
public Object[] minus(Object[] removeMe)
removeMe - an array of elements to remove.
public Object[] minus(Object operand)
operand - an element to remove from the array.
public Object[] reverse()
public Object[] reverseEach(Closure closure)
closure - a closure to which each item is passed.
public int size()
size() method for an array.
public Object[] sort()
public Object[] sort(Comparator comparator)
comparator - a Comparator used for the comparison.
public Object[] sort(Closure closure)
closure - a Closure used as a comparator.
public String toArrayString()
{1, 2, "a"}.
public List toList()
public SpreadMap toSpreadMap()
public String toString()
|
Groovy JDK | |||||||||