org.apache.synapse.commons.executors.queues

## Class UnboundedQueue<E>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractQueue<E>
    - - org.apache.synapse.commons.executors.queues.UnboundedQueue<E>

- Type Parameters:
    `E` -
  All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Queue<E>, InternalQueue<E>

      public class UnboundedQueue<E>
      extends java.util.AbstractQueue<E>
      implements InternalQueue<E>

  An unbounded queue backed by and ArrayList.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnboundedQueue(int priority)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(java.lang.Object o)`
    `int` | `drainTo(java.util.Collection<? super E> c)` Drain items from this queue to the specified collection
    `int` | `drainTo(java.util.Collection<? super E> c, int maxElements)` Drain items from this queue to the specified collection
    `int` | `getCapacity()` Return the capacity of the queue
    `java.util.concurrent.locks.Condition` | `getNotFullCond()` Get not full condition
    `int` | `getPriority()` Get the Priority of the queue
    `java.util.Iterator<E>` | `iterator()`
    `boolean` | `offer(E e)`
    `E` | `peek()`
    `E` | `poll()`
    `int` | `remainingCapacity()` Remaining capacity of the queue.
    `boolean` | `remove(java.lang.Object o)`
    `void` | `setNotFullCond(java.util.concurrent.locks.Condition condition)` Get not full condition
    `void` | `setPriority(int p)` Set the priority
    `int` | `size()`

    - ### Methods inherited from class java.util.AbstractQueue

      `add, addAll, clear, element, remove`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString`

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

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

    - ### Methods inherited from interface java.util.Queue

      `add, element, remove`

    - ### Methods inherited from interface java.util.Collection

      `addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### UnboundedQueue

          public UnboundedQueue(int priority)

  - ### Method Detail

    - #### iterator

          public java.util.Iterator<E> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<E>`
      Specified by:
        `iterator` in interface `java.util.Collection<E>`
      Specified by:
        `iterator` in class `java.util.AbstractCollection<E>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Collection<E>`
      Specified by:
        `size` in class `java.util.AbstractCollection<E>`

    - #### offer

          public boolean offer(E e)

      Specified by:
        `offer` in interface `java.util.Queue<E>`

    - #### poll

          public E poll()

      Specified by:
        `poll` in interface `java.util.Queue<E>`

    - #### peek

          public E peek()

      Specified by:
        `peek` in interface `java.util.Queue<E>`

    - #### getPriority

          public int getPriority()

      Description copied from interface: `InternalQueue`
      Get the Priority of the queue
      Specified by:
        `getPriority` in interface `InternalQueue<E>`
      Returns:
        priority

    - #### setPriority

          public void setPriority(int p)

      Description copied from interface: `InternalQueue`
      Set the priority
      Specified by:
        `setPriority` in interface `InternalQueue<E>`
      Parameters:
        `p` - priority

    - #### getNotFullCond

          public java.util.concurrent.locks.Condition getNotFullCond()

      Description copied from interface: `InternalQueue`
      Get not full condition
      Specified by:
        `getNotFullCond` in interface `InternalQueue<E>`
      Returns:
        not full condition

    - #### setNotFullCond

          public void setNotFullCond(java.util.concurrent.locks.Condition condition)

      Description copied from interface: `InternalQueue`
      Get not full condition
      Specified by:
        `setNotFullCond` in interface `InternalQueue<E>`
      Parameters:
        `condition` - condition

    - #### drainTo

          public int drainTo(java.util.Collection<? super E> c)

      Description copied from interface: `InternalQueue`
      Drain items from this queue to the specified collection
      Specified by:
        `drainTo` in interface `InternalQueue<E>`
      Parameters:
        `c` - collection to add item
      Returns:
        number of items added

    - #### drainTo

          public int drainTo(java.util.Collection<? super E> c,
                             int maxElements)

      Description copied from interface: `InternalQueue`
      Drain items from this queue to the specified collection
      Specified by:
        `drainTo` in interface `InternalQueue<E>`
      Parameters:
        `c` - collection to add item
        `maxElements` - maximum number of element to drain
      Returns:
        number of items added

    - #### remainingCapacity

          public int remainingCapacity()

      Description copied from interface: `InternalQueue`
      Remaining capacity of the queue. Unbounded queues should return Integer.MAX_VALUE
      Specified by:
        `remainingCapacity` in interface `InternalQueue<E>`
      Returns:
        remaining capacity

    - #### getCapacity

          public int getCapacity()

      Description copied from interface: `InternalQueue`
      Return the capacity of the queue
      Specified by:
        `getCapacity` in interface `InternalQueue<E>`
      Returns:
        capacity of thr queue

    - #### contains

          public boolean contains(java.lang.Object o)

      Specified by:
        `contains` in interface `java.util.Collection<E>`
      Overrides:
        `contains` in class `java.util.AbstractCollection<E>`

    - #### remove

          public boolean remove(java.lang.Object o)

      Specified by:
        `remove` in interface `java.util.Collection<E>`
      Overrides:
        `remove` in class `java.util.AbstractCollection<E>`

Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.