## com.sun.grizzly.async
Class AsyncQueue<K,E>

    java.lang.Object
      com.sun.grizzly.async.AsyncQueue<K,E>

    public class AsyncQueue<K,E>

extends Object

Class implements `Map`-like collection, maps keys to values, where single key could have queue of correspondent values.

Author:
  Alexey Stashok

Nested Class Summary
`protected class` `AsyncQueue.AsyncQueueEntry` `AsyncQueue` data unit

Constructor Summary
`AsyncQueue()`

Method Summary
`void` `clear()`
`protected AsyncQueue.AsyncQueueEntry` `getAsyncQueueEntry(K key)`
`boolean` `isEmpty(K key)` Checks if `K` key related queue is empty.
`protected AsyncQueue.AsyncQueueEntry` `obtainAsyncQueueEntry(K key)`
`void` `offer(K key, E queueRecord)` Add data to the `AsyncQueue`, corresponding to the given `E` key
`E` `peek(K key)` Get head element of `E` key related queue.
`E` `poll(K key)` Get head element of `K` key related queue.
`void` `removeEntry(K key)` Remove head element of `K` key related queue.
`int` `size(K key)` Get the size of `K` key related queue.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AsyncQueue

    public AsyncQueue()

Method Detail

### offer

    public void offer(K key,
                      E queueRecord)

  Add data to the `AsyncQueue`, corresponding to the given `E` key

  Parameters:
    `key` - `E`
    `queueRecord` - data unit

### peek

    public E peek(K key)

  Get head element of `E` key related queue. Element will not be removed from queue.

  Parameters:
    `key` - `K`
  Returns:
    `E` data unit

### poll

    public E poll(K key)

  Get head element of `K` key related queue. Element will be removed from queue.

  Parameters:
    `key` - `K`
  Returns:
    `E` data unit

### removeEntry

    public void removeEntry(K key)

  Remove head element of `K` key related queue.

  Parameters:
    `key` - `K`

### size

    public int size(K key)

  Get the size of `K` key related queue.

  Parameters:
    `key` - `K`
  Returns:
    size of `K` key related queue.

### isEmpty

    public boolean isEmpty(K key)

  Checks if `K` key related queue is empty.

  Parameters:
    `key` - `K`
  Returns:
    true, if `K` key related queue is empty, false otherwise

### clear

    public void clear()

### obtainAsyncQueueEntry

    protected AsyncQueue.AsyncQueueEntry obtainAsyncQueueEntry(K key)

### getAsyncQueueEntry

    protected AsyncQueue.AsyncQueueEntry getAsyncQueueEntry(K key)

Copyright © 2008 SUN Microsystems. All Rights Reserved.