Package edu.jas.util

Class OneSubSetIterator<E>

  • All Implemented Interfaces:
    java.util.Iterator<java.util.List<E>>

    class OneSubSetIterator<E>
    extends java.lang.Object
    implements java.util.Iterator<java.util.List<E>>
    One-subset iterator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Iterator<E> iter  
      java.util.List<E> set
      data structure.
    • Constructor Summary

      Constructors 
      Constructor Description
      OneSubSetIterator​(java.util.List<E> set)
      OneSubSetIterator 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
    • Field Detail

      • set

        public final java.util.List<E> set
        data structure.
      • iter

        private java.util.Iterator<E> iter
    • Constructor Detail

      • OneSubSetIterator

        public OneSubSetIterator​(java.util.List<E> set)
        OneSubSetIterator 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>