|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovyx.gpars.util.PAUtils
public abstract class PAUtils
Handy methods build PA from different types
Constructor Summary | |
---|---|
PAUtils()
|
Method Summary | ||
---|---|---|
static groovy.lang.Closure |
buildClosureForMaps(groovy.lang.Closure cl)
If the passed-in closure expects two arguments, it is considered to be a map-iterative code and is then wrapped with a single-argument closure, which unwraps the key:value pairs for the original closure. |
|
static groovy.lang.Closure |
buildClosureForMapsWithIndex(groovy.lang.Closure cl)
If the passed-in closure expects three arguments, it is considered to be a map-iterative_with_index code and is then wrapped with a two-argument closure, which unwraps the key:value pairs for the original closure. |
|
static
|
buildResultMap(java.util.Collection<java.util.Map.Entry<K,V>> result)
Builds a resulting map out of an map entry collection |
|
static java.lang.String[] |
createArray(java.lang.CharSequence value)
|
|
static java.util.Map.Entry<java.lang.Object,java.lang.Object>[] |
createArray(java.util.Map<java.lang.Object,java.lang.Object> map)
|
|
static java.util.Collection<java.lang.Object> |
createCollection(java.lang.Iterable<java.lang.Object> object)
|
|
static java.util.Collection<java.lang.Object> |
createCollection(java.util.Iterator<java.lang.Object> iterator)
|
|
static java.util.Comparator<java.lang.Object> |
createComparator(groovy.lang.Closure handler)
Builds a comparator depending on the number of arguments accepted by the supplied closure. |
|
static groovy.lang.Closure |
createGroupByClosure(groovy.lang.Closure cl,
java.util.concurrent.ConcurrentMap<java.lang.Object,java.util.List<java.lang.Object>> map)
Creates a closure that will insert elements in the appropriate group |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PAUtils()
Method Detail |
---|
public static java.util.Collection<java.lang.Object> createCollection(java.lang.Iterable<java.lang.Object> object)
public static java.util.Collection<java.lang.Object> createCollection(java.util.Iterator<java.lang.Object> iterator)
public static java.lang.String[] createArray(java.lang.CharSequence value)
public static java.util.Map.Entry<java.lang.Object,java.lang.Object>[] createArray(java.util.Map<java.lang.Object,java.lang.Object> map)
public static groovy.lang.Closure buildClosureForMaps(groovy.lang.Closure cl)
cl
- The closure to use for parallel methods
public static groovy.lang.Closure buildClosureForMapsWithIndex(groovy.lang.Closure cl)
cl
- The closure to use for parallel methods
public static <K,V> java.util.Map<K,V> buildResultMap(java.util.Collection<java.util.Map.Entry<K,V>> result)
result
- The collection containing map entries
public static java.util.Comparator<java.lang.Object> createComparator(groovy.lang.Closure handler)
handler
- The one or two argument closure to build a comparator on
public static groovy.lang.Closure createGroupByClosure(groovy.lang.Closure cl, java.util.concurrent.ConcurrentMap<java.lang.Object,java.util.List<java.lang.Object>> map)
cl
- The distinction closuremap
- The map of groups to contribute to
|
Copyright © 2008–2010 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |