Class QueueInt


  • public class QueueInt
    extends Object
    A simple queue of ints
    Since:
    0.8
    • Constructor Detail

      • QueueInt

        public QueueInt​(int capacity)
        Create a queue of specified initial capacity. The queue can grow if required.
        Parameters:
        capacity - the initial capacity
    • Method Detail

      • get

        public final int get()
        Retrieve the next element from the queue.
        Returns:
        the next element
      • size

        public final int size()
        The number of elements available for retrieval.
        Returns:
        the size
      • put

        public final void put​(int x)
        Add an element to the back of the queue.
        Parameters:
        x - the element to add