Handy methods build PA from different types
Constructor and description |
---|
PAUtils
() |
Type | Name and description |
---|---|
static groovy.lang.Closure<T> |
buildClosureForMaps(groovy.lang.Closure<T> 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<T> |
buildClosureForMapsWithIndex(groovy.lang.Closure<T> 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 java.util.Map<K, V> |
buildResultMap(java.util.Collection<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 Map.Entry<K, V>[] |
createArray(java.util.Map<K, V> map) |
static java.util.Collection<T> |
createCollection(java.lang.Iterable<T> object) |
static java.util.Collection<T> |
createCollection(java.util.Iterator<T> iterator) |
static java.util.Comparator<java.lang.Object> |
createComparator(groovy.lang.Closure<java.lang.Object> handler) Builds a comparator depending on the number of arguments accepted by the supplied closure. |
static groovy.lang.Closure<java.lang.Object> |
createGroupByClosure(groovy.lang.Closure<K> cl, java.util.concurrent.ConcurrentMap<K, java.util.List<T>> map) Creates a closure that will insert elements in the appropriate group |
static void |
evaluateArguments(Pool pool, java.lang.Object[] args, int current, java.util.List<java.lang.Object> soFarArgs, DataflowVariable<java.lang.Object> result, groovy.lang.Closure<T> original, boolean pooledThreadFlag) Performs a single step in the evaluation of parameters passed into an asynchronous function |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), 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() |
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. If the supplied closure doesn't expect two arguments, it is returned unchanged.
cl
- The closure to use for parallel methodsIf 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. If the supplied closure doesn't expect three arguments, it is returned unchanged.
cl
- The closure to use for parallel methodsBuilds a resulting map out of an map entry collection
result
- The collection containing map entriesBuilds a comparator depending on the number of arguments accepted by the supplied closure.
handler
- The one or two argument closure to build a comparator onCreates a closure that will insert elements in the appropriate group
cl
- The distinction closuremap
- The map of groups to contribute toPerforms a single step in the evaluation of parameters passed into an asynchronous function
pool
- The thread pool to useargs
- The list of original argumentscurrent
- The index of the current argument to evaluatesoFarArgs
- A list of arguments evaluated so farresult
- The DFV expecting the function result to be bound to once calculatedoriginal
- The original non-asynchronous function to invoke once all arguments are availablepooledThreadFlag
- Indicates, whether we now run in a pooled thread so we don't have to schedule the original function invocation, once all arguments have been boundCopyright © 2008–2014 Václav Pech. All Rights Reserved.