Class LambdasPooling
- java.lang.Object
-
- AbstractPooling
-
- LambdasPooling
-
- All Implemented Interfaces:
OnThreadCompletedListener
public class LambdasPooling extends AbstractPooling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classLambdasPooling.HeavyLoadClass
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringFIRST_DIVIDEprivate static java.lang.StringHEAVY_OPERATIONSprivate static intMAXFprivate LambdasPooling.HeavyLoadClassmHeavyLoadClassprivate java.util.concurrent.atomic.AtomicReference<java.lang.Double>mHeavyOperationResultprivate java.util.concurrent.atomic.AtomicReference<java.util.List<java.lang.String>>mPrimeFactorsResultprivate static java.lang.StringPRIME_FACTORSprivate static java.lang.StringSECON_DIVIDE
-
Constructor Summary
Constructors Constructor Description LambdasPooling()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter()voidbefore()voidonThreadCompletedListener(java.lang.Thread thread, java.lang.Throwable exception)When a thread finish its execution, if using aNotifyingThreadand the class is subscribed, this method is called, with theRunnablewhich corresponds the just finished thread, and theThrowablecontaining the exception (if any exception has benn thrown).voidtest()-
Methods inherited from class AbstractPooling
getThreadsPooling, target
-
-
-
-
Field Detail
-
HEAVY_OPERATIONS
private static final java.lang.String HEAVY_OPERATIONS
- See Also:
- Constant Field Values
-
FIRST_DIVIDE
private static final java.lang.String FIRST_DIVIDE
- See Also:
- Constant Field Values
-
SECON_DIVIDE
private static final java.lang.String SECON_DIVIDE
- See Also:
- Constant Field Values
-
PRIME_FACTORS
private static final java.lang.String PRIME_FACTORS
- See Also:
- Constant Field Values
-
MAXF
private static final int MAXF
- See Also:
- Constant Field Values
-
mHeavyOperationResult
private java.util.concurrent.atomic.AtomicReference<java.lang.Double> mHeavyOperationResult
-
mPrimeFactorsResult
private java.util.concurrent.atomic.AtomicReference<java.util.List<java.lang.String>> mPrimeFactorsResult
-
mHeavyLoadClass
private LambdasPooling.HeavyLoadClass mHeavyLoadClass
-
-
Method Detail
-
before
public void before()
- Overrides:
beforein classAbstractPooling
-
test
public void test()
- Overrides:
testin classAbstractPooling
-
after
public void after() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
onThreadCompletedListener
public void onThreadCompletedListener(@NotNull java.lang.Thread thread, @Nullable java.lang.Throwable exception)Description copied from class:AbstractPoolingWhen a thread finish its execution, if using aNotifyingThreadand the class is subscribed, this method is called, with theRunnablewhich corresponds the just finished thread, and theThrowablecontaining the exception (if any exception has benn thrown).Refer to
NotifyingThread.addOnThreadCompletedListener(OnThreadCompletedListener)for getting more information about subscribing classes.- Specified by:
onThreadCompletedListenerin interfaceOnThreadCompletedListener- Overrides:
onThreadCompletedListenerin classAbstractPooling- Parameters:
thread- the thread that has just finished its execution.exception- the exception if happened, elsenull.
-
-