|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a Queue with List like semantics, allowing addition and removal at any point in the queue. Typically this will be implemented using some kind of LinkedList
Field Summary | |
static Object[] |
EMPTY_ARRAY
|
Method Summary | |
void |
add(int index,
Object element)
Inserts the specified element at the specified position in this list. |
QueueListEntry |
add(Object o)
Appends the specified element to the end of this list. |
QueueListEntry |
addBefore(Object o,
QueueListEntry node)
Insert an Entry before this entry |
QueueListEntry |
addFirst(Object o)
Inserts the given element at the beginning of this list. |
QueueListEntry |
addLast(Object o)
Appends the given element to the end of this list. |
void |
clear()
Removes all of the elements from this list. |
boolean |
contains(Object o)
Returns true if this list contains the specified element. |
Object |
get(int index)
Returns the element at the specified position in this list. |
Object |
getFirst()
Returns the first element in this list. |
QueueListEntry |
getFirstEntry()
Retrieve the first entry for the linked list |
Object |
getLast()
Returns the last element in this list. |
QueueListEntry |
getLastEntry()
Retrieve the last entry for the linked list |
QueueListEntry |
getNextEntry(QueueListEntry node)
Retrieve the next entry after this entry |
QueueListEntry |
getPrevEntry(QueueListEntry node)
Retrive the previous entry after this entry |
int |
indexOf(Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if the List does not contain this element. |
boolean |
isEmpty()
is the list empty? |
int |
lastIndexOf(Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element. |
Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
remove(Object o)
Removes the first occurrence of the specified element in this list. |
void |
remove(QueueListEntry node)
Remove a DefaultQueueListEntry |
Object |
removeFirst()
Removes and returns the first element from this list. |
Object |
removeLast()
Removes and returns the last element from this list. |
void |
rotate()
Move the head of the list to the back of the list |
Object |
set(int index,
Object element)
Replaces the element at the specified position in this list with the specified element. |
int |
size()
Returns the number of elements in this list. |
Object[] |
toArray()
Returns an array containing all of the elements in this list in the correct order. |
Field Detail |
public static final Object[] EMPTY_ARRAY
Method Detail |
public Object getFirst() throws JMSException
JMSException
public Object getLast() throws JMSException
JMSException
public Object removeFirst() throws JMSException
JMSException
public void rotate() throws JMSException
JMSException
public Object removeLast() throws JMSException
JMSException
public QueueListEntry addFirst(Object o) throws JMSException
o
- the element to be inserted at the beginning of this list.
JMSException
public QueueListEntry addLast(Object o) throws JMSException
o
- the element to be inserted at the end of this list.
JMSException
public boolean contains(Object o) throws JMSException
o
- element whose presence in this list is to be tested.
JMSException
public int size() throws JMSException
JMSException
public boolean isEmpty() throws JMSException
JMSException
public QueueListEntry add(Object o) throws JMSException
o
- element to be appended to this list.
JMSException
public boolean remove(Object o) throws JMSException
o
- element to be removed from this list, if present.
JMSException
public void clear() throws JMSException
JMSException
public Object get(int index) throws JMSException
index
- index of element to return.
IndexOutOfBoundsException
- if the specified index is is out of range (index < 0 || index >= size()).
JMSException
public Object set(int index, Object element) throws JMSException
index
- index of element to replace.element
- element to be stored at the specified position.
IndexOutOfBoundsException
- if the specified index is out of range (index < 0 || index >= size()).
JMSException
public void add(int index, Object element) throws JMSException
index
- index at which the specified element is to be inserted.element
- element to be inserted.
IndexOutOfBoundsException
- if the specified index is out of range (index < 0 || index > size()).
JMSException
public Object remove(int index) throws JMSException
index
- the index of the element to removed.
IndexOutOfBoundsException
- if the specified index is out of range (index < 0 || index >= size()).
JMSException
public int indexOf(Object o) throws JMSException
o
- element to search for.
JMSException
public int lastIndexOf(Object o) throws JMSException
o
- element to search for.
JMSException
public QueueListEntry getFirstEntry() throws JMSException
JMSException
public QueueListEntry getLastEntry() throws JMSException
JMSException
public QueueListEntry getNextEntry(QueueListEntry node) throws JMSException
node
-
JMSException
public QueueListEntry getPrevEntry(QueueListEntry node) throws JMSException
node
-
JMSException
public QueueListEntry addBefore(Object o, QueueListEntry node) throws JMSException
o
- the elment to insertnode
- the Entry to insert the object before
JMSException
public void remove(QueueListEntry node) throws JMSException
node
- the DefaultQueueListEntry
JMSException
public Object[] toArray() throws JMSException
JMSException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |