public class ConcurrentCharQueue extends CharQueue implements ConcurrentCollection
CharQueue.CharQueueIterable, CharQueue.CharQueueIterator| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentCharQueue()
Creates a new Queue which can hold 16 values without needing to resize backing array.
|
ConcurrentCharQueue(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(char object)
Prepend given object to the head.
|
void |
addLast(char 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) |
char |
first()
Returns the first (head) item in the queue (without removing it).
|
char |
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(char 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.Character> |
iterator()
Returns an iterator for the items in the queue.
|
char |
last()
Returns the last (tail) item in the queue (without removing it).
|
boolean |
notEmpty()
Returns true if the queue has one or more items.
|
char |
removeFirst()
Remove the first item from the queue.
|
char |
removeIndex(int index)
Removes and returns the item at the specified index.
|
char |
removeLast()
Remove the last item from the queue.
|
boolean |
removeValue(char 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 ConcurrentCharQueue()
public ConcurrentCharQueue(int initialSize)
initialSize - public int size()
public void addLast(char object)
public void addFirst(char object)
addFirst in class CharQueueobject - can be nulladdLast(char)public void ensureCapacity(int additional)
ensureCapacity in class CharQueueadditional - public char removeFirst()
removeFirst in class CharQueuejava.util.NoSuchElementException - when queue is emptypublic char removeLast()
removeLast in class CharQueuejava.util.NoSuchElementException - when queue is emptyremoveFirst()public int indexOf(char value)
public boolean removeValue(char value)
removeValue in class CharQueuevalue - public char removeIndex(int index)
removeIndex in class CharQueueindex - public boolean notEmpty()
public boolean isEmpty()
public char first()
first in class CharQueuejava.util.NoSuchElementException - when queue is emptyaddFirst(char),
removeFirst()public char last()
last in class CharQueuejava.util.NoSuchElementException - when queue is emptyaddLast(char),
removeLast()public char get(int index)
first().public void clear()
public java.util.Iterator<java.lang.Character> iterator()
public java.lang.String toString(java.lang.String separator)
public org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock