public final class RepeatBlock extends Object implements Block
| Constructor and Description | 
|---|
| RepeatBlock(int repeatTimes,
           Block block) | 
| RepeatBlock(IntSupplier repeatTimes,
           Block block)Creates a repeat block, that before starting execution takes number of
 iterations from the given supplier. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | forAllPossiblePieces(Consumer<AbstractPiece> consumer)Calls consumer for each Piece:
 - in no particular order
 - potentially calling multiple times on same Piece
 - even if Piece might never be returned in the iterator
 - it will be called at least once for every piece that is
   going to be returned by iterator
 Can be used for static analysis/introspection of the block,
 without actually executing them. | 
| PieceCount | getPieceCount()How many pieces are in this block. | 
| Iterator<AbstractPiece> | iterator()Create iterator representing all pieces needed to be executed
 in this block. | 
| String | toString() | 
| static Block | unlimited(Block block)Create a repeat block that executes unlimited number of times. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic RepeatBlock(int repeatTimes,
                   Block block)
public RepeatBlock(IntSupplier repeatTimes, Block block)
public static Block unlimited(Block block)
public Iterator<AbstractPiece> iterator()
Blockiterator in interface Iterable<AbstractPiece>iterator in interface Blockpublic void forAllPossiblePieces(Consumer<AbstractPiece> consumer)
BlockforAllPossiblePieces in interface Blockpublic PieceCount getPieceCount()
BlockgetPieceCount in interface BlockCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.