|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.service.impl.QueueListSupport
A base class which is useful for implementation inheritence when implementing a persistent QueueList
Nested Class Summary | |
static class |
QueueListSupport.Header
|
static class |
QueueListSupport.Node
|
Field Summary | |
protected static Long |
HEAD_KEY
|
Fields inherited from interface org.activemq.service.QueueList |
EMPTY_ARRAY |
Constructor Summary | |
QueueListSupport()
|
Method Summary | |
void |
add(int index,
Object element)
Inserts the specified element at the specified position in this list. |
QueueListEntry |
add(Object value)
Appends the specified element to the end of this list. |
QueueListEntry |
addBefore(Object value,
QueueListEntry entry)
Insert an Entry before this entry |
QueueListEntry |
addFirst(Object value)
Inserts the given element at the beginning of this list. |
QueueListEntry |
addLast(Object value)
Appends the given element to the end of this list. |
boolean |
contains(Object value)
Returns true if this list contains the specified element. |
protected Long |
createKey(QueueListSupport.Header header)
|
protected QueueListSupport.Node |
createNode()
|
protected QueueListSupport.Node |
doAddBefore(QueueListSupport.Header header,
QueueListSupport.Node nextNode,
Object element)
|
protected QueueListSupport.Node |
doAddLast(Object value,
QueueListSupport.Header header)
|
protected abstract void |
doRemoveNode(QueueListSupport.Node node)
|
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 |
protected abstract QueueListSupport.Header |
getHeader()
Looks up the header object, lazily creating one if the current table is empty |
Object |
getLast()
Returns the last element in this list. |
QueueListEntry |
getLastEntry()
Retrieve the last entry for the linked list |
QueueListEntry |
getNextEntry(QueueListEntry entry)
Retrieve the next entry after this entry |
protected QueueListSupport.Node |
getNode(int index)
|
protected abstract QueueListSupport.Node |
getNode(Long key)
|
protected QueueListSupport.Node |
getNode(QueueListSupport.Header header,
int index)
|
QueueListEntry |
getPrevEntry(QueueListEntry entry)
Retrive the previous entry after this entry |
int |
indexOf(Object value)
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 value)
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. |
void |
remove(QueueListEntry entry)
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. |
protected boolean |
removeNode(QueueListSupport.Node node)
|
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. |
protected static long |
unwrapLong(Long key)
|
protected abstract void |
updateHeader(QueueListSupport.Header header)
Writes the header back to disk after its been changed |
protected void |
updateNextNode(Long nextKey,
Long key)
|
protected abstract void |
updateNode(QueueListSupport.Node node)
Updates the node |
protected void |
updatePreviousNode(Long previousKey,
Long key)
|
protected static Long |
wrapLong(long value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.activemq.service.QueueList |
clear, remove |
Field Detail |
protected static final Long HEAD_KEY
Constructor Detail |
public QueueListSupport()
Method Detail |
public Object getFirst() throws JMSException
QueueList
getFirst
in interface QueueList
JMSException
public Object getLast() throws JMSException
QueueList
getLast
in interface QueueList
JMSException
public Object removeFirst() throws JMSException
QueueList
removeFirst
in interface QueueList
JMSException
public Object removeLast() throws JMSException
QueueList
removeLast
in interface QueueList
JMSException
public QueueListEntry addFirst(Object value) throws JMSException
QueueList
addFirst
in interface QueueList
value
- the element to be inserted at the beginning of this list.
JMSException
public QueueListEntry addLast(Object value) throws JMSException
QueueList
addLast
in interface QueueList
value
- the element to be inserted at the end of this list.
JMSException
public boolean contains(Object value) throws JMSException
QueueList
contains
in interface QueueList
value
- element whose presence in this list is to be tested.
JMSException
public int size() throws JMSException
QueueList
size
in interface QueueList
JMSException
public boolean isEmpty() throws JMSException
QueueList
isEmpty
in interface QueueList
JMSException
public QueueListEntry add(Object value) throws JMSException
QueueList
add
in interface QueueList
value
- element to be appended to this list.
JMSException
public Object get(int index) throws JMSException
QueueList
get
in interface QueueList
index
- index of element to return.
JMSException
public Object set(int index, Object element) throws JMSException
QueueList
set
in interface QueueList
index
- index of element to replace.element
- element to be stored at the specified position.
JMSException
public void add(int index, Object element) throws JMSException
QueueList
add
in interface QueueList
index
- index at which the specified element is to be inserted.element
- element to be inserted.
JMSException
public Object remove(int index) throws JMSException
QueueList
remove
in interface QueueList
index
- the index of the element to removed.
JMSException
public int indexOf(Object value) throws JMSException
QueueList
indexOf
in interface QueueList
value
- element to search for.
JMSException
public int lastIndexOf(Object value) throws JMSException
QueueList
lastIndexOf
in interface QueueList
value
- element to search for.
JMSException
public QueueListEntry getFirstEntry() throws JMSException
QueueList
getFirstEntry
in interface QueueList
JMSException
public QueueListEntry getLastEntry() throws JMSException
QueueList
getLastEntry
in interface QueueList
JMSException
public QueueListEntry getNextEntry(QueueListEntry entry) throws JMSException
QueueList
getNextEntry
in interface QueueList
entry
-
JMSException
public QueueListEntry getPrevEntry(QueueListEntry entry) throws JMSException
QueueList
getPrevEntry
in interface QueueList
entry
-
JMSException
public QueueListEntry addBefore(Object value, QueueListEntry entry) throws JMSException
QueueList
addBefore
in interface QueueList
value
- the elment to insertentry
- the Entry to insert the object before
JMSException
public void remove(QueueListEntry entry) throws JMSException
QueueList
remove
in interface QueueList
entry
- the DefaultQueueListEntry
JMSException
public Object[] toArray() throws JMSException
QueueList
toArray
in interface QueueList
JMSException
public void rotate() throws JMSException
QueueList
rotate
in interface QueueList
JMSException
protected Long createKey(QueueListSupport.Header header) throws IOException, JMSException
IOException
JMSException
protected boolean removeNode(QueueListSupport.Node node) throws IOException, JMSException
IOException
JMSException
protected abstract QueueListSupport.Header getHeader() throws IOException, JMSException
IOException
JMSException
protected abstract void updateHeader(QueueListSupport.Header header) throws IOException, JMSException
header
-
IOException
JMSException
protected abstract void updateNode(QueueListSupport.Node node) throws IOException, JMSException
node
-
IOException
JMSException
protected abstract QueueListSupport.Node getNode(Long key) throws IOException, JMSException
IOException
JMSException
protected QueueListSupport.Node getNode(int index) throws IOException, JMSException
IOException
JMSException
protected QueueListSupport.Node getNode(QueueListSupport.Header header, int index) throws IOException, JMSException
IOException
JMSException
protected QueueListSupport.Node doAddLast(Object value, QueueListSupport.Header header) throws IOException, JMSException
IOException
JMSException
protected void updateNextNode(Long nextKey, Long key) throws IOException, JMSException
IOException
JMSException
protected void updatePreviousNode(Long previousKey, Long key) throws IOException, JMSException
IOException
JMSException
protected QueueListSupport.Node doAddBefore(QueueListSupport.Header header, QueueListSupport.Node nextNode, Object element) throws JMSException, IOException
JMSException
IOException
protected abstract void doRemoveNode(QueueListSupport.Node node) throws IOException, JMSException
IOException
JMSException
protected static Long wrapLong(long value)
protected static long unwrapLong(Long key)
protected QueueListSupport.Node createNode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |