public class Countdown
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Countdown() |
Modifier and Type | Method and Description |
---|---|
static Countdown |
create()
Creates a new instance.
|
long |
getSleepTime() |
Countdown |
setSleepTime(long sleepTime) |
java.lang.String |
toString() |
boolean |
waitUntilFalse(ICondition condition,
Duration maxTimeToWait)
Waits in a loop until either the value of the condition becomes false
or the maxTimeToWait is exceeded.
|
boolean |
waitUntilFalse(ICondition condition,
long maxTimeToWait)
Waits in a loop until either the value of the condition becomes false
or the maxTimeToWait is exceeded.
|
boolean |
waitUntilTrue(ICondition condition,
Duration maxTimeToWait)
Waits in a loop until either the value of the condition becomes true
or the maxTimeToWait is exceeded.
|
boolean |
waitUntilTrue(ICondition condition,
long maxTimeToWait)
Waits in a loop until either the value of the condition becomes true
or the maxTimeToWait is exceeded.
|
protected boolean |
waitWhile(ICondition condition,
boolean continueLoopValue,
long maxTimeToWait) |
static void |
whileFalse(ICondition condition,
Duration duration)
Runs an empty loop until either the condition is true or the specified
time in milliseconds is over.
|
static void |
whileFalse(ICondition condition,
long millis)
Runs an empty loop until either the condition is true or the specified
time in milliseconds is over.
|
static void |
whileTrue(ICondition condition,
Duration duration)
Runs an empty loop until either the condition is false or the specified
time in milliseconds is over (more or less).
|
static void |
whileTrue(ICondition condition,
long millis)
Runs an empty loop until either the condition is false or the specified
time in milliseconds is over (more or less).
|
public static Countdown create()
public static void whileTrue(ICondition condition, long millis)
condition
- A condition that is used to continue (true) or finish (false) the loop.millis
- The time in milliseconds after which the loop gets terminated independently of the condition.public static void whileTrue(ICondition condition, Duration duration)
condition
- A condition that is used to continue (true) or finish (false) the loopduration
- The duration after which the loop gets terminated independently of the condition.public static void whileFalse(ICondition condition, long millis)
condition
- A condition that is used to continue (false) or finish (true) the loopmillis
- The time in milliseconds after which the loop gets terminated independently of the condition.public static void whileFalse(ICondition condition, Duration duration)
condition
- A condition that is used to continue (false) or finish (true) the loopduration
- The duration after which the loop gets terminated independently of the condition.public boolean waitUntilTrue(ICondition condition, long maxTimeToWait)
condition
- The condition to check (might be null).maxTimeToWait
- Maximum time in milliseconds to wait.public boolean waitUntilTrue(ICondition condition, Duration maxTimeToWait)
condition
- The condition to check (might be null).maxTimeToWait
- Maximum time in milliseconds to wait.public boolean waitUntilFalse(ICondition condition, long maxTimeToWait)
condition
- The condition to check (might be null).maxTimeToWait
- Maximum time in milliseconds to wait.public boolean waitUntilFalse(ICondition condition, Duration maxTimeToWait)
condition
- The condition to check (might be null).maxTimeToWait
- Maximum time in milliseconds to wait.public long getSleepTime()
public Countdown setSleepTime(long sleepTime)
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean waitWhile(ICondition condition, boolean continueLoopValue, long maxTimeToWait)