Package icyllis.modernui.util

# Class MpmcArrayQueue<E>

java.lang.Object
icyllis.modernui.util.MpmcArrayQueue<E>

All Implemented Interfaces:
  `Pools.Pool<E>`

@ThreadSafe public class MpmcArrayQueue<E> extends Object implements Pools.Pool<E>

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MpmcArrayQueue(int capacity)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `E`
  `acquire()`
  `boolean`
  `isEmpty()`
  `boolean`
  `isFull()`
  `boolean`
  `release(E instance)`
  Release an instance to the pool.
  `int`
  `size()`

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

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

- ## Constructor Details

  - ### MpmcArrayQueue

    public MpmcArrayQueue(int capacity)

- ## Method Details

  - ### size

    public int size()

  - ### isEmpty

    public boolean isEmpty()

  - ### isFull

    public boolean isFull()

  - ### acquire

    @Nullable public E acquire()
    Specified by:
      `acquire` in interface `Pools.Pool<E>`
    Returns:
      An instance from the pool if such, null otherwise.

  - ### release

    public boolean release(@NonNull E instance)
    Description copied from interface: `Pools.Pool`
    Release an instance to the pool.
    Specified by:
      `release` in interface `Pools.Pool<E>`
    Parameters:
      `instance` - The instance to release.
    Returns:
      Whether the instance was put in the pool.