Package edu.jas.util
Class CartesianProductIterator<E>
- java.lang.Object
-
- edu.jas.util.CartesianProductIterator<E>
-
- All Implemented Interfaces:
java.util.Iterator<java.util.List<E>>
class CartesianProductIterator<E> extends java.lang.Object implements java.util.Iterator<java.util.List<E>>
Cartesian product iterator.
-
-
Constructor Summary
Constructors Constructor Description CartesianProductIterator(java.util.List<java.lang.Iterable<E>> comps)
CartesianProduct iterator constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test for availability of a next tuple.java.util.List<E>
next()
Get next tuple.void
remove()
Remove a tuple if allowed.
-
-
-
Constructor Detail
-
CartesianProductIterator
public CartesianProductIterator(java.util.List<java.lang.Iterable<E>> comps)
CartesianProduct iterator constructor.- Parameters:
comps
- components of the Cartesian product.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Test for availability of a next tuple.- Specified by:
hasNext
in interfacejava.util.Iterator<E>
- Returns:
- true if the iteration has more tuples, else false.
-
next
public java.util.List<E> next()
Get next tuple.- Specified by:
next
in interfacejava.util.Iterator<E>
- Returns:
- next tuple.
-
remove
public void remove()
Remove a tuple if allowed.- Specified by:
remove
in interfacejava.util.Iterator<E>
-
-