Class UnboundedQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
org.apache.synapse.commons.executors.queues.UnboundedQueue<E>
- Type Parameters:
E-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>,InternalQueue<E>
An unbounded queue backed by and ArrayList.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintdrainTo(Collection<? super E> c) Drain items from this queue to the specified collectionintdrainTo(Collection<? super E> c, int maxElements) Drain items from this queue to the specified collectionintReturn the capacity of the queueGet not full conditionintGet the Priority of the queueiterator()booleanpeek()poll()intRemaining capacity of the queue.booleanvoidsetNotFullCond(Condition condition) Get not full conditionvoidsetPriority(int p) Set the priorityintsize()Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
UnboundedQueue
public UnboundedQueue(int priority)
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<E>
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein classAbstractCollection<E>
-
offer
-
poll
-
peek
-
getPriority
public int getPriority()Description copied from interface:InternalQueueGet the Priority of the queue- Specified by:
getPriorityin interfaceInternalQueue<E>- Returns:
- priority
-
setPriority
public void setPriority(int p) Description copied from interface:InternalQueueSet the priority- Specified by:
setPriorityin interfaceInternalQueue<E>- Parameters:
p- priority
-
getNotFullCond
Description copied from interface:InternalQueueGet not full condition- Specified by:
getNotFullCondin interfaceInternalQueue<E>- Returns:
- not full condition
-
setNotFullCond
Description copied from interface:InternalQueueGet not full condition- Specified by:
setNotFullCondin interfaceInternalQueue<E>- Parameters:
condition- condition
-
drainTo
Description copied from interface:InternalQueueDrain items from this queue to the specified collection- Specified by:
drainToin interfaceInternalQueue<E>- Parameters:
c- collection to add item- Returns:
- number of items added
-
drainTo
Description copied from interface:InternalQueueDrain items from this queue to the specified collection- Specified by:
drainToin interfaceInternalQueue<E>- Parameters:
c- collection to add itemmaxElements- maximum number of element to drain- Returns:
- number of items added
-
remainingCapacity
public int remainingCapacity()Description copied from interface:InternalQueueRemaining capacity of the queue. Unbounded queues should return Integer.MAX_VALUE- Specified by:
remainingCapacityin interfaceInternalQueue<E>- Returns:
- remaining capacity
-
getCapacity
public int getCapacity()Description copied from interface:InternalQueueReturn the capacity of the queue- Specified by:
getCapacityin interfaceInternalQueue<E>- Returns:
- capacity of thr queue
-
contains
- Specified by:
containsin interfaceCollection<E>- Overrides:
containsin classAbstractCollection<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Overrides:
removein classAbstractCollection<E>
-