Adds various function extensions to java.util.List implementations.
| Function Summary | |
|---|---|
java.util.List
|
asImmutable()
|
java.util.List
|
asSynchronized()
|
Object
|
pop()
|
java.util.List
|
sort()
|
java.util.List
|
sortEach(Function func)
|
java.util.List asImmutable()
Returns an immutable version of this list.
frozenList = list.asImmutable()
java.util.List asSynchronized()
Returns a synchronized version of this list.
multiThreadList = list.asSynchronized()
Object pop()
Pops the last item off the list. The last item will be returned and removed from the list.
lastItem = list.pop()
java.util.List sort()
Sorts the list according to the natural order.
sortedList = list.sort()
java.util.List sortEach(Function func)
Sorts the list using the passed function to determine order. The function will receive two parameters, and should return > 0 if the first is greater, < 0 if the first is less, and 0 if equal.
sortedList = list.sort(function(val1, val2) { return val1.compareTo(val2) })