|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<DequeueEvent>
umontreal.iro.lecuyer.contactcenters.queue.WaitingQueue
umontreal.iro.lecuyer.contactcenters.queue.StandardWaitingQueue
public final class StandardWaitingQueue
Extends the WaitingQueue class for a standard waiting queue, without
priority. The queue uses a List to store the dequeue events ordered
by insertion times. By default, a doubly-linked list is used, which
implements insertion and removal of the first and last elements in constant
time.
| Field Summary |
|---|
| Fields inherited from class umontreal.iro.lecuyer.contactcenters.queue.WaitingQueue |
|---|
dqTypeRet |
| Constructor Summary | |
|---|---|
StandardWaitingQueue()
Constructs a new waiting queue using a LinkedList to
store the elements. |
|
StandardWaitingQueue(List<DequeueEvent> list)
Constructs a new waiting queue using the given List
implementation to manage the elements. |
|
| Method Summary | |
|---|---|
protected void |
elementsAdd(DequeueEvent dqEvent)
Adds the new dequeued event dqEvent to the internal data structure representing the waiting queue. |
protected void |
elementsClear()
Clears all elements in the data structure representing the queued contacts. |
protected DequeueEvent |
elementsGetFirst()
Returns the first element of the waiting queue's internal data structure, or throws a NoSuchElementException if no such element exists. |
protected DequeueEvent |
elementsGetLast()
Returns the last element of the waiting queue's internal data structure, or throws a NoSuchElementException if no such element exists. |
protected boolean |
elementsIsEmpty()
Determines if the internal waiting queue data structure is empty. |
protected Iterator<DequeueEvent> |
elementsIterator()
Returns an iterator capable of traversing, in the correct order, the elements in the waiting queue's internal data structure. |
protected DequeueEvent |
elementsRemoveFirst()
Removes and returns the first element in the waiting queue's internal data structure. |
protected DequeueEvent |
elementsRemoveLast()
Removes and returns the last element in the waiting queue's internal data structure. |
String |
toString()
|
| Methods inherited from class umontreal.iro.lecuyer.contactcenters.queue.WaitingQueue |
|---|
add, add, addFromOldEvent, addWaitingQueueListener, clear, clear, clearWaitingQueueListeners, getAttributes, getDefaultDequeueType, getDequeueEvent, getFirst, getId, getLast, getMaximalQueueTime, getMaximalQueueTimeGenerator, getName, getWaitingQueueListeners, init, isEmpty, iterator, iterator, notifyDequeued, notifyEnqueued, notifyInit, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, removeWaitingQueueListener, restore, save, setDefaultDequeueType, setId, setMaximalQueueTimeGenerator, setName, size, size |
| Methods inherited from class java.util.AbstractQueue |
|---|
add, addAll, element, remove |
| Methods inherited from class java.util.AbstractCollection |
|---|
contains, containsAll, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
contains, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public StandardWaitingQueue()
LinkedList to
store the elements.
public StandardWaitingQueue(List<DequeueEvent> list)
List
implementation to manage the elements. This list must contain only
DequeueEvent objects and it will be cleared before being used.
list - the list containing the queued contacts.| Method Detail |
|---|
protected void elementsClear()
WaitingQueue
elementsClear in class WaitingQueueprotected Iterator<DequeueEvent> elementsIterator()
WaitingQueueWaitingQueue.iterator(int) method because this iterator returns the
contacts marked for dequeue as well as the contacts still enqueued. If the
returned iterator does not implement remove(),
WaitingQueue.remove(Contact,int) and WaitingQueue.getDequeueEvent(Contact) will not work
properly.
elementsIterator in class WaitingQueueprotected void elementsAdd(DequeueEvent dqEvent)
WaitingQueue
elementsAdd in class WaitingQueuedqEvent - the dequeue event being added.protected boolean elementsIsEmpty()
WaitingQueue
elementsIsEmpty in class WaitingQueueprotected DequeueEvent elementsGetFirst()
WaitingQueueNoSuchElementException if no such element exists.
elementsGetFirst in class WaitingQueueprotected DequeueEvent elementsGetLast()
WaitingQueueNoSuchElementException if no such element exists.
elementsGetLast in class WaitingQueueprotected DequeueEvent elementsRemoveFirst()
WaitingQueueNoSuchElementException if no such element
exists.
elementsRemoveFirst in class WaitingQueueprotected DequeueEvent elementsRemoveLast()
WaitingQueueNoSuchElementException if no such element
exists.
elementsRemoveLast in class WaitingQueuepublic String toString()
toString in class WaitingQueue
|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||