Package edu.jas.util
Class PowerSetIterator<E>
- java.lang.Object
-
- edu.jas.util.PowerSetIterator<E>
-
- All Implemented Interfaces:
java.util.Iterator<java.util.List<E>>
class PowerSetIterator<E> extends java.lang.Object implements java.util.Iterator<java.util.List<E>>
Power set iterator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
PowerSetIterator.Mode
-
Constructor Summary
Constructors Constructor Description PowerSetIterator(java.util.List<E> set)
PowerSetIterator constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test for availability of a next subset.java.util.List<E>
next()
Get next subset.void
remove()
Remove the last subset returned from underlying set if allowed.
-
-
-
Field Detail
-
set
public final java.util.List<E> set
data structure.
-
rest
final java.util.List<E> rest
-
current
final E current
-
recIter
private PowerSetIterator<E> recIter
-
mode
PowerSetIterator.Mode mode
-
-
Constructor Detail
-
PowerSetIterator
public PowerSetIterator(java.util.List<E> set)
PowerSetIterator constructor.- Parameters:
set
- generating set.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Test for availability of a next subset.- Specified by:
hasNext
in interfacejava.util.Iterator<E>
- Returns:
- true if the iteration has more subsets, else false.
-
next
public java.util.List<E> next()
Get next subset.- Specified by:
next
in interfacejava.util.Iterator<E>
- Returns:
- next subset.
-
remove
public void remove()
Remove the last subset returned from underlying set if allowed.- Specified by:
remove
in interfacejava.util.Iterator<E>
-
-