(Inital implementation)
- Version:
- $Revision: 1.6 $ ($Author: vlads $) $Date: 2004/12/07 09:04:52 $
- Author:
- michaellif
- See Also:
- Serialized Form
Constructor Summary |
Queue()
Creats an empty queue |
Method Summary |
void |
clear()
Removes all elements at the queue. |
java.lang.Object |
dequeue()
Removes the element at the top of the queue. |
java.lang.Object[] |
dequeueAll()
Removes all the elements from the queue and returns the values as array. |
java.lang.Object[] |
dequeueAll(java.lang.Object[] a)
Removes all the elements from the queue and returns the values as array. |
java.lang.Object |
enqueue(java.lang.Object element)
Inserts a new element at the rear of the queue. |
boolean |
enqueueAll(Queue elements)
Inserts a Collection of new element at the rear of the queue. |
java.lang.Object |
enqueueFirst(java.lang.Object element)
Inserts a new element at the begining of the queue. |
java.lang.Object |
get(int i)
|
java.lang.Object |
getFirst()
Inspects the element at the top of the queue without removing it. |
java.lang.Object |
getLast()
Inspects the element at the end of the queue without removing it. |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
int |
size()
|
java.lang.String |
toString()
Log4j event Queue dumper |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Queue
public Queue()
- Creats an empty queue
enqueue
public java.lang.Object enqueue(java.lang.Object element)
- Inserts a new element at the rear of the queue.
- Parameters:
element
- element to be inserted.
enqueueFirst
public java.lang.Object enqueueFirst(java.lang.Object element)
- Inserts a new element at the begining of the queue.
- Parameters:
element
- element to be inserted.
enqueueAll
public boolean enqueueAll(Queue elements)
- Inserts a Collection of new element at the rear of the queue.
- Parameters:
elements
- Collection to be inserted.
dequeue
public java.lang.Object dequeue()
- Removes the element at the top of the queue.
- Returns:
- the removed element.
- Throws:
EmptyQueueException
- if the queue is empty.
getFirst
public java.lang.Object getFirst()
- Inspects the element at the top of the queue without removing it.
- Returns:
- the element at the top of the queue.
- Throws:
EmptyQueueException
- if the queue is empty.
get
public java.lang.Object get(int i)
getLast
public java.lang.Object getLast()
- Inspects the element at the end of the queue without removing it.
- Returns:
- the element at the top of the queue.
- Throws:
EmptyQueueException
- if the queue is empty.
size
public int size()
- Returns:
- the number of elements at the queue.
isEmpty
public boolean isEmpty()
- Returns:
- true if the queue is empty.
clear
public void clear()
- Removes all elements at the queue.
dequeueAll
public java.lang.Object[] dequeueAll()
- Removes all the elements from the queue and returns the values as array.
- Returns:
dequeueAll
public java.lang.Object[] dequeueAll(java.lang.Object[] a)
- Removes all the elements from the queue and returns the values as array.
- Returns:
iterator
public java.util.Iterator iterator()
toString
public java.lang.String toString()
- Log4j event Queue dumper
- Returns:
- String
Copyright © 2004 sourceforge. All Rights Reserved.