org.codehaus.gpars

groovyx.gpars
[Groovy] Class TransparentParallel

java.lang.Object
  groovyx.gpars.TransparentParallel

final class TransparentParallel

Enhances objects by being mixed-in either within a GParsPool.withPool() block or after enhancement by the ParallelEnhancer through the makeConcurrent() method. It overrides the iterative methods, like each, collect and such to delegate to eachParallel, collectParallel and other parallel iterative methods. The collections returned from collect(), findAll() and grep() are again mixed with a TransparentParallel instance, so their iterative methods are transparently parallel as well. Author: Vaclav Pech, Dierk Koenig Date: Oct 30, 2009


Field Summary
private boolean concurrencyActive

 
Constructor Summary
TransparentParallel()

 
Method Summary
java.lang.Object any(groovy.lang.Closure yield)

java.lang.Object collect(groovy.lang.Closure yield)

java.lang.Object collectMany(groovy.lang.Closure yield)

java.lang.Object count(java.lang.Object filter)

java.lang.Object each(groovy.lang.Closure yield)

java.lang.Object eachWithIndex(groovy.lang.Closure yield)

java.lang.Object every(groovy.lang.Closure yield)

java.lang.Object find(groovy.lang.Closure yield)

java.lang.Object findAll(groovy.lang.Closure yield)

java.lang.Object findAny(groovy.lang.Closure yield)

java.lang.Object fold(groovy.lang.Closure yield)

java.lang.Object fold(java.lang.Object seed, groovy.lang.Closure yield)

java.lang.Object grep(java.lang.Object filter)

java.lang.Object groupBy(groovy.lang.Closure yield)

boolean isConcurrencyActive()

Indicates, whether the iterative methods like each() or collect() should have a concurrent or a sequential semantics.

boolean isConcurrent()

Indicates, whether the iterative methods like each() or collect() have been made parallel.

java.lang.Object max(groovy.lang.Closure yield)

java.lang.Object max()

java.lang.Object min(groovy.lang.Closure yield)

java.lang.Object min()

void setConcurrencyActive(boolean flag)

Turns concurrency on and off as needed

java.lang.Object split(groovy.lang.Closure yield)

java.lang.Object sum()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), 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()
 

Field Detail

concurrencyActive

private boolean concurrencyActive


 
Constructor Detail

TransparentParallel

TransparentParallel()


 
Method Detail

any

final java.lang.Object any(groovy.lang.Closure yield)


collect

final java.lang.Object collect(groovy.lang.Closure yield)


collectMany

final java.lang.Object collectMany(groovy.lang.Closure yield)


count

final java.lang.Object count(java.lang.Object filter)


each

final java.lang.Object each(groovy.lang.Closure yield)


eachWithIndex

final java.lang.Object eachWithIndex(groovy.lang.Closure yield)


every

final java.lang.Object every(groovy.lang.Closure yield)


find

final java.lang.Object find(groovy.lang.Closure yield)


findAll

final java.lang.Object findAll(groovy.lang.Closure yield)


findAny

final java.lang.Object findAny(groovy.lang.Closure yield)


fold

final java.lang.Object fold(groovy.lang.Closure yield)


fold

final java.lang.Object fold(java.lang.Object seed, groovy.lang.Closure yield)


grep

final java.lang.Object grep(java.lang.Object filter)


groupBy

final java.lang.Object groupBy(groovy.lang.Closure yield)


isConcurrencyActive

boolean isConcurrencyActive()
Indicates, whether the iterative methods like each() or collect() should have a concurrent or a sequential semantics.


isConcurrent

boolean isConcurrent()
Indicates, whether the iterative methods like each() or collect() have been made parallel. Always true once a collection is enhanced through the makeConcurrent() method. The concurrencyActive flag then indicates, whether the enhanced collection has concurrent or the original sequential semantics


max

final java.lang.Object max(groovy.lang.Closure yield)


max

final java.lang.Object max()


min

final java.lang.Object min(groovy.lang.Closure yield)


min

final java.lang.Object min()


setConcurrencyActive

void setConcurrencyActive(boolean flag)
Turns concurrency on and off as needed
Parameters:
flag - True, if the collection processing methods should have parallel semantics, false if they should call the original sequential implementation


split

final java.lang.Object split(groovy.lang.Closure yield)


sum

final java.lang.Object sum()


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.