|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.activemq.service.impl.DefaultQueueList
Linked list class to provide uniformly named methods to get,remove and insert an element at the beginning and end of the list. These operations allow linked lists to be used as a stack, queue, or double-ended queue (dequeue).
| Field Summary |
| Fields inherited from interface org.activemq.service.QueueList |
EMPTY_ARRAY |
| Constructor Summary | |
DefaultQueueList()
Constructs an empty list. |
|
| Method Summary | |
void |
add(int index,
java.lang.Object element)
Inserts the specified element at the specified position in this list. |
QueueListEntry |
add(java.lang.Object o)
Appends the specified element to the end of this list. |
QueueListEntry |
addAllBefore(java.util.Collection c,
QueueListEntry node)
|
QueueListEntry |
addAllFirst(java.util.Collection c)
|
QueueListEntry |
addBefore(java.lang.Object o,
QueueListEntry node)
Insert an Entry before this entry |
QueueListEntry |
addFirst(java.lang.Object o)
Inserts the given element at the beginning of this list. |
QueueListEntry |
addLast(java.lang.Object o)
Appends the given element to the end of this list. |
void |
clear()
Removes all of the elements from this list. |
java.lang.Object |
clone()
Returns a shallow copy of this DefaultQueueList. |
boolean |
contains(java.lang.Object o)
Returns true if this list contains the specified element. |
DefaultQueueListEntry |
entry(int index)
|
java.lang.Object |
get(int index)
Returns the element at the specified position in this list. |
java.lang.Object |
get(java.lang.Object obj)
get the object from the queue |
java.lang.Object |
getFirst()
Returns the first element in this list. |
QueueListEntry |
getFirstEntry()
Retrieve the first entry for the linked list |
java.lang.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(java.lang.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(java.lang.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. |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
remove(java.lang.Object o)
Removes the first occurrence of the specified element in this list. |
void |
remove(QueueListEntry node)
Remove a DefaultQueueListEntry |
java.lang.Object |
removeFirst()
remove the first object from the list |
java.lang.Object |
removeLast()
remove the last object |
void |
rotate()
move the first object to the back of the list |
java.lang.Object |
set(int index,
java.lang.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. |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this list in the correct order. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DefaultQueueList()
| Method Detail |
public java.lang.Object getFirst()
QueueList
getFirst in interface QueueListpublic java.lang.Object getLast()
QueueList
getLast in interface QueueListpublic java.lang.Object removeFirst()
removeFirst in interface QueueListpublic void rotate()
rotate in interface QueueListpublic java.lang.Object removeLast()
removeLast in interface QueueListpublic QueueListEntry addAllFirst(java.util.Collection c)
public QueueListEntry addFirst(java.lang.Object o)
QueueList
addFirst in interface QueueListo - the element to be inserted at the beginning of this list.
public QueueListEntry addLast(java.lang.Object o)
QueueList
addLast in interface QueueListo - the element to be inserted at the end of this list.
public boolean contains(java.lang.Object o)
QueueList
contains in interface QueueListo - element whose presence in this list is to be tested.
public int size()
QueueList
size in interface QueueListpublic boolean isEmpty()
QueueList
isEmpty in interface QueueListpublic QueueListEntry add(java.lang.Object o)
QueueList
add in interface QueueListo - element to be appended to this list.
public boolean remove(java.lang.Object o)
QueueList
remove in interface QueueListo - element to be removed from this list, if present.
public void clear()
QueueList
clear in interface QueueListpublic java.lang.Object get(int index)
QueueList
get in interface QueueListindex - index of element to return.
public java.lang.Object get(java.lang.Object obj)
obj -
public java.lang.Object set(int index,
java.lang.Object element)
QueueList
set in interface QueueListindex - index of element to replace.element - element to be stored at the specified position.
public void add(int index,
java.lang.Object element)
QueueList
add in interface QueueListindex - index at which the specified element is to be inserted.element - element to be inserted.public java.lang.Object remove(int index)
QueueList
remove in interface QueueListindex - the index of the element to removed.
public DefaultQueueListEntry entry(int index)
public int indexOf(java.lang.Object o)
QueueList
indexOf in interface QueueListo - element to search for.
public int lastIndexOf(java.lang.Object o)
QueueList
lastIndexOf in interface QueueListo - element to search for.
public QueueListEntry getFirstEntry()
QueueList
getFirstEntry in interface QueueListpublic QueueListEntry getLastEntry()
QueueList
getLastEntry in interface QueueListpublic QueueListEntry getNextEntry(QueueListEntry node)
QueueList
getNextEntry in interface QueueListnode -
public QueueListEntry getPrevEntry(QueueListEntry node)
QueueList
getPrevEntry in interface QueueListnode -
public QueueListEntry addBefore(java.lang.Object o,
QueueListEntry node)
QueueList
addBefore in interface QueueListo - the elment to insertnode - the Entry to insert the object before
public QueueListEntry addAllBefore(java.util.Collection c,
QueueListEntry node)
public void remove(QueueListEntry node)
QueueList
remove in interface QueueListnode - the DefaultQueueListEntrypublic java.lang.Object clone()
public java.lang.Object[] toArray()
QueueList
toArray in interface QueueListpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||