Class PausingNoOpCallable
- java.lang.Object
-
- com.pervasivecode.utils.concurrent.testing.PausingNoOpCallable
-
-
Constructor Summary
Constructors Constructor Description PausingNoOpCallable(int inputValue)
Create a new PausingNoOpCallable that will cube and return the specified int value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
call()
Return the input value, raised to the third power.boolean
hasPaused()
boolean
hasUnpaused()
void
unpause()
void
waitUntilPaused()
boolean
waitUntilPaused(long amount, TimeUnit unit)
-
-
-
Constructor Detail
-
PausingNoOpCallable
public PausingNoOpCallable(int inputValue)
Create a new PausingNoOpCallable that will cube and return the specified int value. Note that since values larger than about 1290 will overflow an int when raised to the third power, this method will throw an exception if the inputValue is larger than that.- Parameters:
inputValue
- An int value that will be cubed and returned when the Callable finishes.- Throws:
IllegalArgumentException
- if inputValue is larger than 1290.
-
-
Method Detail
-
hasPaused
public boolean hasPaused()
-
waitUntilPaused
public void waitUntilPaused() throws InterruptedException
- Throws:
InterruptedException
-
waitUntilPaused
public boolean waitUntilPaused(long amount, TimeUnit unit) throws InterruptedException
- Throws:
InterruptedException
-
unpause
public void unpause()
-
hasUnpaused
public boolean hasUnpaused()
-
-