public abstract class IterableBuilder<T> extends Object implements Builder<T>
| Constructor and Description |
|---|
IterableBuilder(Iterable<Block<T>> blocks,
T seed) |
| Modifier and Type | Method and Description |
|---|---|
T |
build()
Build all the blocks into a final result.
|
Iterable<T> |
iterable(int iterations)
Creates an iterable for this builder that will iterate the supplied number of times.
|
Iterator<T> |
iterator() |
public T build()
Builderpublic Iterable<T> iterable(int iterations)
Builder
If the supplied number of iterations is less than the number of Blocks then only that number of blocks
will be built and have their results returned.
If the supplied number of iterations is greater than the number of Blocks then all blocks will be built
and the final result of the built Blocks will be passed back into the first Block where they will
be iterated through again until the supplied number of iterations is reached.
Copyright © 2016. All rights reserved.