public class ConcurrentLongQueue extends LongQueue implements ConcurrentCollection
LongQueue.LongQueueIterable, LongQueue.LongQueueIterator| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentLongQueue()
Creates a new Queue which can hold 16 values without needing to resize backing array.
|
ConcurrentLongQueue(int initialSize)
Creates a new Queue which can hold the specified number of values without needing to resize backing array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFirst(long object)
Prepend given object to the head.
|
void |
addLast(long object)
Append given object to the tail.
|
void |
clear()
Removes all values from this queue.
|
void |
ensureCapacity(int additional)
Increases the size of the backing array to accommodate the specified number of additional items.
|
boolean |
equals(java.lang.Object object) |
long |
first()
Returns the first (head) item in the queue (without removing it).
|
long |
get(int index)
Retrieves the value in queue without removing it.
|
org.mini2Dx.lockprovider.ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
int |
indexOf(long value)
Returns the index of first occurrence of value in the queue, or -1 if no such value exists.
|
boolean |
isEmpty()
Returns true if the queue is empty.
|
java.util.Iterator<java.lang.Long> |
iterator()
Returns an iterator for the items in the queue.
|
long |
last()
Returns the last (tail) item in the queue (without removing it).
|
boolean |
notEmpty()
Returns true if the queue has one or more items.
|
long |
removeFirst()
Remove the first item from the queue.
|
long |
removeIndex(int index)
Removes and returns the item at the specified index.
|
long |
removeLast()
Remove the last item from the queue.
|
boolean |
removeValue(long value)
Removes the first instance of the specified value in the queue.
|
int |
size()
Returns the size in a thread-safe manner
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String separator) |
public ConcurrentLongQueue()
public ConcurrentLongQueue(int initialSize)
initialSize - public int size()
public void addLast(long object)
public void addFirst(long object)
addFirst in class LongQueueobject - can be nulladdLast(long)public void ensureCapacity(int additional)
ensureCapacity in class LongQueueadditional - public long removeFirst()
removeFirst in class LongQueuejava.util.NoSuchElementException - when queue is emptypublic long removeLast()
removeLast in class LongQueuejava.util.NoSuchElementException - when queue is emptyremoveFirst()public int indexOf(long value)
public boolean removeValue(long value)
removeValue in class LongQueuevalue - public long removeIndex(int index)
removeIndex in class LongQueueindex - public boolean notEmpty()
public boolean isEmpty()
public long first()
first in class LongQueuejava.util.NoSuchElementException - when queue is emptyaddFirst(long),
removeFirst()public long last()
last in class LongQueuejava.util.NoSuchElementException - when queue is emptyaddLast(long),
removeLast()public long get(int index)
first().public void clear()
public java.util.Iterator<java.lang.Long> iterator()
public java.lang.String toString(java.lang.String separator)
public org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock