Package edu.jas.util

Class CartesianProductIterator<E>

java.lang.Object
edu.jas.util.CartesianProductIterator<E>
All Implemented Interfaces:
Iterator<List<E>>

class CartesianProductIterator<E> extends Object implements Iterator<List<E>>
Cartesian product iterator.
  • Field Details

  • Constructor Details

    • CartesianProductIterator

      public CartesianProductIterator(List<Iterable<E>> comps)
      CartesianProduct iterator constructor.
      Parameters:
      comps - components of the Cartesian product.
  • Method Details

    • hasNext

      public boolean hasNext()
      Test for availability of a next tuple.
      Specified by:
      hasNext in interface Iterator<E>
      Returns:
      true if the iteration has more tuples, else false.
    • next

      public List<E> next()
      Get next tuple.
      Specified by:
      next in interface Iterator<E>
      Returns:
      next tuple.
    • remove

      public void remove()
      Remove a tuple if allowed.
      Specified by:
      remove in interface Iterator<E>