Package org.apfloat.samples
Class PiParallel.ThreadLimitedOperation<T>
- java.lang.Object
-
- org.apfloat.samples.PiParallel.ThreadLimitedOperation<T>
-
- All Implemented Interfaces:
java.io.Serializable,Operation<T>
- Enclosing class:
- PiParallel
protected static class PiParallel.ThreadLimitedOperation<T> extends java.lang.Object implements Operation<T>
Class to execute operations while settingApfloatContext.setNumberOfProcessors(int)to some value.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intnumberOfProcessorsprivate Operation<T>operationprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ThreadLimitedOperation(Operation<T> operation, int numberOfProcessors)Wrap an existing operation to a thread limited context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Texecute()Execute the operation.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
numberOfProcessors
private int numberOfProcessors
-
-
Constructor Detail
-
ThreadLimitedOperation
public ThreadLimitedOperation(Operation<T> 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.
-
-