org.apfloat.samples
Class PiParallel.ThreadLimitedOperation

java.lang.Object
  extended byorg.apfloat.samples.PiParallel.ThreadLimitedOperation
All Implemented Interfaces:
Operation, Serializable
Enclosing class:
PiParallel

protected static class PiParallel.ThreadLimitedOperation
extends Object
implements Operation

Class to execute operations while setting ApfloatContext.setNumberOfProcessors(int) to some value.

See Also:
Serialized Form

Constructor Summary
PiParallel.ThreadLimitedOperation(Operation operation, int numberOfProcessors)
          Wrap an existing operation to a thread limited context.
 
Method Summary
 Object execute()
          Execute the operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PiParallel.ThreadLimitedOperation

public PiParallel.ThreadLimitedOperation(Operation operation,
                                         int numberOfProcessors)
Wrap an existing operation to a thread limited context.

Parameters:
operation - The operation whose execution will have a limited number of threads available.
numberOfProcessors - The maximum number of threads that can be used in the execution.
Method Detail

execute

public Object execute()
Execute the operation.

Specified by:
execute in interface Operation
Returns:
Result of the operation.