|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.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 (deque).
Field Summary |
Fields inherited from interface org.codehaus.activemq.service.QueueList |
EMPTY_ARRAY |
Constructor Summary | |
DefaultQueueList()
Constructs an empty list. |
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. |
Object |
clone()
Returns a shallow copy of this DefaultQueueList. |
boolean |
contains(Object o)
Returns true if this list contains the specified element. |
DefaultQueueListEntry |
entry(int index)
|
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()
remove the first object from the list |
Object |
removeLast()
remove the last object |
void |
rotate()
move the first object 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. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultQueueList()
Method Detail |
public Object getFirst()
QueueList
getFirst
in interface QueueList
public Object getLast()
QueueList
getLast
in interface QueueList
public Object removeFirst()
removeFirst
in interface QueueList
public void rotate()
rotate
in interface QueueList
public Object removeLast()
removeLast
in interface QueueList
public QueueListEntry addFirst(Object o)
QueueList
addFirst
in interface QueueList
o
- the element to be inserted at the beginning of this list.
public QueueListEntry addLast(Object o)
QueueList
addLast
in interface QueueList
o
- the element to be inserted at the end of this list.
public boolean contains(Object o)
QueueList
contains
in interface QueueList
o
- element whose presence in this list is to be tested.
public int size()
QueueList
size
in interface QueueList
public boolean isEmpty()
QueueList
isEmpty
in interface QueueList
public QueueListEntry add(Object o)
QueueList
add
in interface QueueList
o
- element to be appended to this list.
public boolean remove(Object o)
QueueList
remove
in interface QueueList
o
- element to be removed from this list, if present.
public void clear()
QueueList
clear
in interface QueueList
public Object get(int index)
QueueList
get
in interface QueueList
index
- index of element to return.
public Object set(int index, Object element)
QueueList
set
in interface QueueList
index
- index of element to replace.element
- element to be stored at the specified position.
public void add(int index, Object element)
QueueList
add
in interface QueueList
index
- index at which the specified element is to be inserted.element
- element to be inserted.public Object remove(int index)
QueueList
remove
in interface QueueList
index
- the index of the element to removed.
public DefaultQueueListEntry entry(int index)
public int indexOf(Object o)
QueueList
indexOf
in interface QueueList
o
- element to search for.
public int lastIndexOf(Object o)
QueueList
lastIndexOf
in interface QueueList
o
- element to search for.
public QueueListEntry getFirstEntry()
QueueList
getFirstEntry
in interface QueueList
public QueueListEntry getLastEntry()
QueueList
getLastEntry
in interface QueueList
public QueueListEntry getNextEntry(QueueListEntry node)
QueueList
getNextEntry
in interface QueueList
node
-
public QueueListEntry getPrevEntry(QueueListEntry node)
QueueList
getPrevEntry
in interface QueueList
node
-
public QueueListEntry addBefore(Object o, QueueListEntry node)
QueueList
addBefore
in interface QueueList
o
- the elment to insertnode
- the Entry to insert the object before
public void remove(QueueListEntry node)
QueueList
remove
in interface QueueList
node
- the DefaultQueueListEntrypublic Object clone()
public Object[] toArray()
QueueList
toArray
in interface QueueList
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |