- All Implemented Interfaces:
Iterator<List<E>>
Power set iterator.
-
Field Summary
Fields
final int
(package private) final List<E>
-
Constructor Summary
Constructors
KsubSetIterator constructor.
-
Method Summary
boolean
Test for availability of a next subset.
void
Remove the last subset returned from underlying set if allowed.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Details
-
KsubSetIterator
public KsubSetIterator(List<E> set,
int k)
KsubSetIterator constructor.
- Parameters:
set - generating set.
k - subset size.
-
Method Details
-
hasNext
public boolean hasNext()
Test for availability of a next subset.
- Specified by:
hasNext in interface Iterator<E>
- Returns:
- true if the iteration has more subsets, else false.
-
next
Get next subset.
- Specified by:
next in interface Iterator<E>
- Returns:
- next subset.
-
remove
public void remove()
Remove the last subset returned from underlying set if allowed.
- Specified by:
remove in interface Iterator<E>