RoundQueue

net.printer.utils

## Class RoundQueue<T>

- java.lang.Object
- - net.printer.utils.RoundQueue<T>

- All Implemented Interfaces:
    java.io.Serializable

      public class RoundQueue<T>
      extends java.lang.Object
      implements java.io.Serializable

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoundQueue(int size)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addLast(T element)` add in last
    `void` | `clear()` Clear all the saved data
    `T` | `get(int index)` Returns the specified location value
    `T` | `getFirst()` get the first element into the queue.
    `int` | `gethead()` get the head of the queue
    `T` | `getLast()` get the last element into queue
    `int` | `gettail()` get the tail
    `int` | `indexOf(T key)` get the element by the index,if don't have return -1.
    `boolean` | `isEmpty()` empty
    `boolean` | `isFull()` full
    `int` | `realSize()` the size of queue
    `T` | `removeFirst()` remove the first

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RoundQueue

          public RoundQueue(int size)

  - ### Method Detail

    - #### addLast

          public void addLast(T element)

      add in last
      Parameters:
        `element` -

    - #### removeFirst

          public T removeFirst()

      remove the first
      Returns:
        int

    - #### realSize

          public int realSize()

      the size of queue
      Returns:
        int

    - #### isEmpty

          public boolean isEmpty()

      empty
      Returns:
        boolean

    - #### isFull

          public boolean isFull()

      full
      Returns:
        boolean

    - #### clear

          public void clear()

      Clear all the saved data

    - #### get

          public T get(int index)

      Returns the specified location value
      Parameters:
        `index` -
      Returns:
        int

    - #### indexOf

          public int indexOf(T key)

      get the element by the index,if don't have return -1. if key is null ,always return -1.
      Parameters:
        `elementy` - The search element
      Returns:
        int

    - #### gethead

          public int gethead()

      get the head of the queue

    - #### gettail

          public int gettail()

      get the tail

    - #### getLast

          public T getLast()

      get the last element into queue

    - #### getFirst

          public T getFirst()

      get the first element into the queue.