T - The element class which is iterated.public class IncreasingSubsetIterator<T> extends SubsetIterator<T>
| Modifier and Type | Field and Description |
|---|---|
private int |
currentSize
The current size of the subsets generated.
|
private boolean |
hasNext
For hasNext().
|
private int[] |
indices
The indices of the generated subsets.
|
private java.util.List<T> |
set
The actual set in a list.
|
| Constructor and Description |
|---|
IncreasingSubsetIterator(java.util.Set<T> set)
Creates a new subset iterator for the given set.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
private void |
increment()
Increments the indices.
|
private int |
increment(int lvl)
Increments the indices.
|
java.util.Set<T> |
next() |
getSet, removeprivate java.util.List<T> set
private int[] indices
private int currentSize
private boolean hasNext
public IncreasingSubsetIterator(java.util.Set<T> set)
set - some set.public boolean hasNext()
hasNext in interface java.util.Iterator<java.util.Set<T>>hasNext in class SubsetIterator<T>public java.util.Set<T> next()
next in interface java.util.Iterator<java.util.Set<T>>next in class SubsetIterator<T>private void increment()
private int increment(int lvl)
lvl - the level