T
- the type of elements being combined and iterated overpublic class CombinationIterator<T> extends Object implements Iterator<List<T>>, ResettableIterator<List<T>>
CombinationIterator
class defines an iterator capable of
combining iterating all possible combinations of multiple collections. At
each step, it returns a list of elements where each element correspond to the
iterated element of the collection specified at the same indexConstructor and Description |
---|
CombinationIterator(Class<T> clazz,
Collection<Collection<T>> items)
Instantiates a new
CombinationIterator object. |
CombinationIterator(Class<T> clazz,
Collection<T>... items)
Instantiates a new
CombinationIterator object. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
List<T> |
next() |
void |
remove() |
void |
reset() |
int |
size()
Gets the number of combinations in this iterator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
@SafeVarargs public CombinationIterator(Class<T> clazz, Collection<T>... items)
CombinationIterator
object.clazz
- the class of the elements being iterateditems
- the collections of elements being iterated, the order will
correspond to the order of the elements returned at each stepNullPointerException
- if clazz
or items
is
null
IllegalArgumentException
- if no collections of items is providedpublic CombinationIterator(Class<T> clazz, Collection<Collection<T>> items)
CombinationIterator
object.clazz
- the class of the elements being iterateditems
- the collections of elements being iterated, the order will
correspond to the order of the elements returned at each stepNullPointerException
- if clazz
or items
is
null
IllegalArgumentException
- if no collections of items is providedpublic int size()
public boolean hasNext()
hasNext
in interface Iterator<List<T>>
Iterator.hasNext()
public List<T> next()
next
in interface Iterator<List<T>>
Iterator.next()
public void remove()
remove
in interface Iterator<List<T>>
Iterator.remove()
public void reset()
reset
in interface ResettableIterator<List<T>>
ResettableIterator.reset()
Copyright (C) 2015-2017 The Helenus Driver Project Authors.