| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| private final AtomicLong | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| private int | |
| private int | |
| public boolean | Returns: true if the queue is empty, false otherwiseReturns true if the queue is empty, otherwise false |
| public T | |
| public void | |
| public T[] | Returns: An array containing the current elements in the queue. The first element of the array is the tail of the queue and the last element is the head of the queueReturns an array of the current elements in the queue. |
| circularArray | back to summary |
|---|---|
| private final AtomicReference<T>[] circularArray | |
| currentIndex | back to summary |
|---|---|
| private final AtomicLong currentIndex | |
| maxSize | back to summary |
|---|---|
| private final int maxSize | |
| CircularLossyQueue | back to summary |
|---|---|
| public CircularLossyQueue(int size) Constructs the circular queue with the specified capacity | |
| depth | back to summary |
|---|---|
| public int depth() Returns the number of items currently in the queue
| |
| getCurrentIndex | back to summary |
|---|---|
| private int getCurrentIndex() | |
| getIndex | back to summary |
|---|---|
| private int getIndex(int index) | |
| isEmtpy | back to summary |
|---|---|
| public boolean isEmtpy() Returns true if the queue is empty, otherwise false
| |
| peek | back to summary |
|---|---|
| public T peek() Returns value at the tail of the queue
| |
| push | back to summary |
|---|---|
| public void push(T newVal) Adds a new item | |
| toArray | back to summary |
|---|---|
| public T[] toArray(T[] type) Returns an array of the current elements in the queue. The order of elements is in reverse order of the order items were added.
| |