E - Should implement the Importance interfacepublic class FixedSizeQueue<E> extends java.util.AbstractQueue<E> implements InternalQueue<E>
| Constructor and Description |
|---|
FixedSizeQueue(int priority,
int capacity)
Create a queue with the given priority and capacity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.Object o) |
int |
drainTo(java.util.Collection<? super E> c)
Drain items from this queue to the specified collection
|
int |
drainTo(java.util.Collection<? super E> c,
int maxElements)
Drain items from this queue to the specified collection
|
int |
getCapacity()
Return the capacity of the queue
|
java.util.concurrent.locks.Condition |
getNotFullCond()
Get not full condition
|
int |
getPriority()
Get the Priority of the queue
|
java.util.Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
int |
remainingCapacity()
Remaining capacity of the queue.
|
boolean |
remove(java.lang.Object o) |
void |
setNotFullCond(java.util.concurrent.locks.Condition notFullCond)
Get not full condition
|
void |
setPriority(int p)
Set the priority
|
int |
size() |
java.lang.String |
toString() |
containsAll, isEmpty, removeAll, retainAll, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic FixedSizeQueue(int priority,
int capacity)
priority - priority of the elements in the queuecapacity - capacity of the queuepublic int getPriority()
InternalQueuegetPriority in interface InternalQueue<E>public void setPriority(int p)
InternalQueuesetPriority in interface InternalQueue<E>p - prioritypublic java.util.concurrent.locks.Condition getNotFullCond()
InternalQueuegetNotFullCond in interface InternalQueue<E>public void setNotFullCond(java.util.concurrent.locks.Condition notFullCond)
InternalQueuesetNotFullCond in interface InternalQueue<E>notFullCond - conditionpublic java.util.Iterator<E> iterator()
public int size()
public java.lang.String toString()
toString in class java.util.AbstractCollection<E>public int remainingCapacity()
InternalQueueremainingCapacity in interface InternalQueue<E>public int drainTo(java.util.Collection<? super E> c)
InternalQueuedrainTo in interface InternalQueue<E>c - collection to add itempublic int drainTo(java.util.Collection<? super E> c, int maxElements)
InternalQueuedrainTo in interface InternalQueue<E>c - collection to add itemmaxElements - maximum number of element to drainpublic int getCapacity()
InternalQueuegetCapacity in interface InternalQueue<E>public boolean contains(java.lang.Object o)
Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.