|
Groovy JDK |
Method Summary | |
---|---|
List
|
asImmutable()
A convenience method for creating an immutable list |
List
|
asSynchronized()
A convenience method for creating a synchronized List |
boolean
|
equals(Object[] right)
Determines if the contents of this list are equal to the contents of the given array in the same order false if either collection is null
|
boolean
|
equals(List right)
Compare the contents of two Lists If numbers exist in the Lists, then they are compared as numbers, for example 2 == 2L is false
|
Process
|
execute()
Executes the command specified by the String list that is the parameter
The first item in the array is the command the others are the parameters
must be String s
can use java
|
Object
|
first()
Returns the first item from the List |
List
|
flatten()
Flatten a list contents (recursively) added to the new collection |
List
|
getAt(IntRange range)
Support the range subscript operator for a List |
List
|
getAt(Collection indices)
Allows a List to be used as the indices to be used on a List |
Object
|
getAt(int idx)
Support the subscript operator for a List |
Object
|
head()
Returns the first item from the List |
Object
|
last()
Returns the last item from the List |
List
|
minus(Collection removeMe)
Create a List composed of the elements of the first list minus the elements of the given collection |
List
|
minus(Object operand)
Create a new List composed of the elements of the first list minus the operand |
Object
|
pop()
Removes the last item from the List is similar to push and pop on a Stack |
boolean
|
push(Object value)
Appends an item to the List |
void
|
putAt(int idx, Object value)
A helper method to allow lists to work with subscript operators |
void
|
putAt(EmptyRange range, Object value)
A helper method to allow lists to work with subscript operators |
void
|
putAt(IntRange range, Collection col)
List subscript assignment operator when given a range as the index and the assignment operand is a collection Example: myList[3
range are relaced with items from the collection
|
void
|
putAt(IntRange range, Object value)
List subscript assignment operator when given a range as the index Example: myList[3
range are relaced with the operand
always treated as a single value
|
void
|
putAt(List splice, List values)
A helper method to allow lists to work with subscript operators |
void
|
putAt(List splice, Object value)
A helper method to allow lists to work with subscript operators |
List
|
reverse()
Reverses the list in reverse order |
List
|
reverseEach(Closure closure)
Iterate over each element of the list in the reverse order |
List
|
tail()
Returns the items from the List excluding the first item |
Method Detail |
---|
public List asImmutable()
public List asSynchronized()
public boolean equals(Object[] right)
false
if either collection is null
.
right
- this Object[] being compared to.
public boolean equals(List right)
null
, the result
is false
.
right
- the List being compared to..
true
if the contents of both lists are identical,
false
otherwise.public Process execute()
String
list that is the parameter.
The first item in the array is the command the others are the parameters. All entries
must be String
s. For more control over the process mechanism in JDK 1.5 you
can use java.lang.ProcessBuilder
.
public Object first()
public List flatten()
public List getAt(IntRange range)
range
- a Range indicating the items to get.
public List getAt(Collection indices)
indices
- a Collection of indices.
public Object getAt(int idx)
idx
- an index.
public Object head()
public Object last()
public List minus(Collection removeMe)
removeMe
- a Collection of elements to remove.
public List minus(Object operand)
operand
- an element to remove from the list.
public Object pop()
public boolean push(Object value)
value
- element to be appended to this list..
public void putAt(int idx, Object value)
idx
- an index.
value
- the value to put at the given index.
public void putAt(EmptyRange range, Object value)
range
- the subset of the list to set.
value
- the values to put at the given sublist or a Collection of values.
public void putAt(IntRange range, Collection col)
myList[3..5] = anotherList
. Items in the given
range are relaced with items from the collection.
range
- the subset of the list to set.
col
- the collection of values to put at the given sublist.
public void putAt(IntRange range, Object value)
myList[3..5] = newItem
. Items in the given
range are relaced with the operand. The value
operand is
always treated as a single value.
range
- the subset of the list to set.
value
- the value to put at the given sublist.
public void putAt(List splice, List values)
splice
- the subset of the list to set.
values
- the value to put at the given sublist.
public void putAt(List splice, Object value)
splice
- the subset of the list to set.
value
- the value to put at the given sublist.
public List reverse()
public List reverseEach(Closure closure)
closure
- a closure to which each item is passed..
public List tail()
|
Groovy JDK |