Queue interface
sufficient for concurrent message passing.| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if empty, false otherwiseThis method's accuracy is subject to concurrent modifications happening as the observation is carried out. |
| public boolean | Returns: true if element was inserted into the queue, false iff fullthe Object to enqueue, not null message)Called from a producer thread subject to the restrictions appropriate to the implementation and according to the
|
| public M | Returns: a message from the queue if one is available, null iff emptyCalled from the consumer thread subject to the restrictions appropriate to the implementation and according to
the |
| public M | Returns: a message from the queue if one is available, null iff emptyCalled from the consumer thread subject to the restrictions appropriate to the implementation and according to
the |
| public int | Returns: number of messages in the queue, between 0 and queue capacity orInteger#MAX_VALUE if not boundedThis method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a best effort rather than absolute value. |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() This method's accuracy is subject to concurrent modifications happening as the observation is carried out.
| |
| offer | back to summary |
|---|---|
| public boolean offer(M message) Called from a producer thread subject to the restrictions appropriate to the implementation and according to the
| |
| peek | back to summary |
|---|---|
| public M peek() Called from the consumer thread subject to the restrictions appropriate to the implementation and according to
the
| |
| poll | back to summary |
|---|---|
| public M poll() Called from the consumer thread subject to the restrictions appropriate to the implementation and according to
the
| |
| size | back to summary |
|---|---|
| public int size() This method's accuracy is subject to concurrent modifications happening as the size is estimated and as such is a best effort rather than absolute value. For some implementations this method may be O(n) rather than O(1).
| |