Class IntQueue

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Integer>

    public final class IntQueue
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.Integer>
    Special class for unboxed int FIFO
    Version:
    4.7
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  IntQueue.QueueIterator  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int element)
      adds an int at the end of the FIFO
      void clear()  
      boolean isEmpty()  
      java.util.Iterator<java.lang.Integer> iterator()  
      int peek()
      inspection of the first element, without removal
      int pop()
      takes the first element, removes it from the FIFO and returns it
      private void resize()
      increase the size of the queue
      int size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • array

        public int[] array
      • start

        public int start
      • stop

        public int stop
    • Constructor Detail

    • Method Detail

      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • add

        public void add​(int element)
        adds an int at the end of the FIFO
        Parameters:
        element - the element to add
      • peek

        public int peek()
        inspection of the first element, without removal
        Returns:
        the first element of the array
      • pop

        public int pop()
        takes the first element, removes it from the FIFO and returns it
        Returns:
        the first element from the FIFO queue
      • size

        public int size()
      • resize

        private void resize()
        increase the size of the queue
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • iterator

        public java.util.Iterator<java.lang.Integer> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Integer>