Modifier and Type | Field and Description |
---|---|
protected java.util.function.Supplier<java.lang.Boolean> |
condition
The function to be applied before each round on the loop to check whether the loop shall continue or break.
|
Constructor and Description |
---|
While(java.util.function.Supplier<java.lang.Boolean> condition)
Construct a new while loop with the given arguments.
|
While(java.util.function.Supplier<java.lang.Boolean> condition,
java.util.function.Consumer<While> code)
Construct a new while loop with the given arguments.
|
Modifier and Type | Method and Description |
---|---|
While |
append(java.util.function.Consumer<While> code)
Append the given code to the end of the looping code of this.
|
protected void |
loop()
The looping cod.
|
protected final java.util.function.Supplier<java.lang.Boolean> condition
public While(java.util.function.Supplier<java.lang.Boolean> condition)
condition
- looping conditionjava.lang.NullPointerException
- if the given 'condition' is nullpublic While(java.util.function.Supplier<java.lang.Boolean> condition, java.util.function.Consumer<While> code)
condition
- looping conditioncode
- first looping codejava.lang.NullPointerException
- if ether the given 'condition' or 'code' is nullpublic While append(java.util.function.Consumer<While> code)
Loop
protected void loop()
Loop
Loop.next(Object)
inside the loop to invoke the code of this loop. Break the loop if it returned false.