Package edu.jas.util

Class LongIterator

  • All Implemented Interfaces:
    java.util.Iterator<java.lang.Long>

    class LongIterator
    extends java.lang.Object
    implements java.util.Iterator<java.lang.Long>
    Long iterator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) long current
      data structure.
      (package private) boolean empty  
      (package private) boolean nonNegative  
      protected long upperBound  
    • Constructor Summary

      Constructors 
      Constructor Description
      LongIterator()
      Long iterator constructor.
      LongIterator​(boolean nn, long ub)
      Long iterator constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getUpperBound()
      Get the upper bound for the iterator.
      boolean hasNext()
      Test for availability of a next long.
      java.lang.Long next()
      Get next Long.
      void remove()
      Remove a tuple if allowed.
      void setUpperBound​(long ub)
      Set the upper bound for the iterator.
      • 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

      • current

        long current
        data structure.
      • empty

        boolean empty
      • nonNegative

        final boolean nonNegative
      • upperBound

        protected long upperBound
    • Constructor Detail

      • LongIterator

        public LongIterator()
        Long iterator constructor.
      • LongIterator

        public LongIterator​(boolean nn,
                            long ub)
        Long iterator constructor.
        Parameters:
        nn - true for an iterator over non-negative longs, false for all elements iterator.
        ub - an upper bound for the entries.
    • Method Detail

      • setUpperBound

        public void setUpperBound​(long ub)
        Set the upper bound for the iterator.
        Parameters:
        ub - an upper bound for the iterator elements.
      • getUpperBound

        public long getUpperBound()
        Get the upper bound for the iterator.
        Returns:
        the upper bound for the iterator elements.
      • hasNext

        public boolean hasNext()
        Test for availability of a next long.
        Specified by:
        hasNext in interface java.util.Iterator<java.lang.Long>
        Returns:
        true if the iteration has more Longs, else false.
      • next

        public java.lang.Long next()
        Get next Long.
        Specified by:
        next in interface java.util.Iterator<java.lang.Long>
        Returns:
        next Long.
      • remove

        public void remove()
        Remove a tuple if allowed.
        Specified by:
        remove in interface java.util.Iterator<java.lang.Long>