SynchronizedQueue (Apache Tomcat 9.0.37 API Documentation)

org.apache.tomcat.util.collections

## Class SynchronizedQueue<T>

- java.lang.Object
- - org.apache.tomcat.util.collections.SynchronizedQueue<T>

- Type Parameters:
    `T` - The type of object managed by this queue

      public class SynchronizedQueue<T>
      extends Object

  This is intended as a (mostly) GC-free alternative to `ConcurrentLinkedQueue` when the requirement is to create an unbounded queue with no requirement to shrink the queue. The aim is to provide the bare minimum of required functionality as quickly as possible with minimum garbage.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SynchronizedQueue()`
    `SynchronizedQueue(int initialSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `boolean` | `offer(T t)`
    `T` | `poll()`
    `int` | `size()`

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

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

- - ### Field Detail

    - #### DEFAULT_SIZE

          public static final int DEFAULT_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SynchronizedQueue

          public SynchronizedQueue()

    - #### SynchronizedQueue

          public SynchronizedQueue(int initialSize)

  - ### Method Detail

    - #### offer

          public boolean offer(T t)

    - #### poll

          public T poll()

    - #### size

          public int size()

    - #### clear

          public void clear()

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.