Package com.ericsson.otp.erlang

# Class GenericQueue

java.lang.Object
com.ericsson.otp.erlang.GenericQueue

public class GenericQueue extends Object
This class implements a generic FIFO queue. There is no upper bound on the length of the queue, items are linked.

## Constructor Summary

Constructors
Constructor
Description
`GenericQueue()`
Create an empty queue

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`flush()`
Clear a queue
`Object`
`get()`
Retrieve an object from the head of the queue, or block until one arrives.
`Object`
`get(long timeout)`
Retrieve an object from the head of the queue, blocking until one arrives or until timeout occurs.
`int`
`getCount()`
`void`
`put(Object o)`
Add an object to the tail of the queue.
`Object`
`tryGet()`

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

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

## Constructor Details

### GenericQueue

public GenericQueue()
Create an empty queue

## Method Details

### flush

public void flush()
Clear a queue

### close

public void close()

### put

public void put(Object o)
Add an object to the tail of the queue.

Parameters:
  `o` - Object to insert in the queue

### get

public Object get()
Retrieve an object from the head of the queue, or block until one arrives.

Returns:
  The object at the head of the queue.

### get

public Object get(long timeout) throws InterruptedException
Retrieve an object from the head of the queue, blocking until one arrives or until timeout occurs.

Parameters:
  `timeout` - Maximum time to block on queue, in ms. Use 0 to poll the queue.
Returns:
  The object at the head of the queue, or null if none arrived in time.
Throws:
  `InterruptedException` - if the operation times out.

### tryGet

public Object tryGet()

### getCount

public int getCount()