Interface ISetIterator

  • All Superinterfaces:
    Iterator<Integer>

    public interface ISetIterator
    extends Iterator<Integer>
    Object to iterate over an ISet values using // more readable but includes autoboxing for(int value:set){ ... } // more verbose but without autoboxing ISetIterator iter = set.primitiveIterator(); while(iter.hasNext()){ int k = iter.nextInt(); ... }
    Author:
    Jean-Guillaume Fages
    • Method Detail

      • reset

        void reset()
        Reset iteration (to avoid creating a new ISetIterator for every iteration)
      • notifyRemoving

        default void notifyRemoving​(int item)
        Inform the iterator that value item has been removed (may require to update iterator structure)
        Parameters:
        item - removed value
      • nextInt

        int nextInt()
        Returns the next int in the iteration. Beware : avoids autoboxing
        Returns:
        the next int in the iteration
        Throws:
        NoSuchElementException - if the iteration has no more elements