public class ProductIterator<T> extends java.lang.Object implements Iterator<java.util.List<T>>
ProductIterator
implements a product iterator, a composite iterator that generates all
possible combinations of items produced by simpler iterators.Modifier | Constructor and Description |
---|---|
|
ProductIterator()
Constructs a product iterator.
|
protected |
ProductIterator(ProductIterator<T> r)
Constructs a copy of the product iterator.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all registered iterators.
|
ProductIterator<T> |
clone()
Returns a copy of the iterator.
|
boolean |
hasValue()
Checks if the iterator is not exhausted (a value is available).
|
void |
init()
Initializes the iterator.
|
Iterator<T> |
iterator(int i)
Returns the i-th iterator of the list.
|
void |
next()
Makes an iteration.
|
void |
registerIterator(Iterator<T> iterator)
Registers the iterator.
|
int |
size()
Returns the number of the registered iterators.
|
void |
stop()
Stops the iterator.
|
java.util.List<T> |
value()
Returns the current value of the iterator.
|
T |
value(int i)
Returns the value of the i-th iterator.
|
public ProductIterator()
protected ProductIterator(ProductIterator<T> r)
r
- the iterator to be copied.public void registerIterator(Iterator<T> iterator)
iterator
- the iterator to be registered.public void clear()
public int size()
public Iterator<T> iterator(int i)
i
- the iterator index.public void init()
Iterator
public boolean hasValue()
Iterator
public T value(int i)
i
- the iterator index.public java.util.List<T> value()
Iterator
public void next()
Iterator
public void stop()
Iterator