Package edu.jas.util

Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • 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 interface java.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 interface java.util.Iterator<E>
        Returns:
        next subset.
      • remove

        public void remove()
        Remove the last subset returned from underlying set if allowed.
        Specified by:
        remove in interface java.util.Iterator<E>