Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.service.impl
Class QueueListSupport

    java.lang.Object
      org.codehaus.activemq.service.impl.QueueListSupport

All Implemented Interfaces:
  QueueList

public abstract class QueueListSupport
extends java.lang.Object
implements QueueList

A base class which is useful for implementation inheritence when implementing a persistent QueueList

Version:
  $Revision: 1.5 $

Nested Class Summary
`static class` | `QueueListSupport.Header`
`static class` | `QueueListSupport.Node`

Field Summary
`protected static java.lang.Long` | `HEAD_KEY`

Fields inherited from interface org.codehaus.activemq.service.QueueList
`EMPTY_ARRAY`

Constructor Summary
`QueueListSupport()`

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 value)` Appends the specified element to the end of this list.
`QueueListEntry` | `addBefore(java.lang.Object value, QueueListEntry entry)` Insert an Entry before this entry
`QueueListEntry` | `addFirst(java.lang.Object value)` Inserts the given element at the beginning of this list.
`QueueListEntry` | `addLast(java.lang.Object value)` Appends the given element to the end of this list.
`boolean` | `contains(java.lang.Object value)` Returns `true` if this list contains the specified element.
`protected java.lang.Long` | `createKey(QueueListSupport.Header header)`
`protected QueueListSupport.Node` | `createNode()`
`protected QueueListSupport.Node` | `doAddBefore(QueueListSupport.Header header, QueueListSupport.Node nextNode, java.lang.Object element)`
`protected QueueListSupport.Node` | `doAddLast(java.lang.Object value, QueueListSupport.Header header)`
`protected abstract void` | `doRemoveNode(QueueListSupport.Node node)`
`java.lang.Object` | `get(int index)` Returns the element at the specified position in this list.
`java.lang.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
`java.lang.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(java.lang.Long key)`
`protected QueueListSupport.Node` | `getNode(QueueListSupport.Header header, int index)`
`QueueListEntry` | `getPrevEntry(QueueListEntry entry)` Retrive the previous entry after this entry
`int` | `indexOf(java.lang.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(java.lang.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.
`java.lang.Object` | `remove(int index)` Removes the element at the specified position in this list.
`void` | `remove(QueueListEntry entry)` Remove a DefaultQueueListEntry
`java.lang.Object` | `removeFirst()` Removes and returns the first element from this list.
`java.lang.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
`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.
`protected static long` | `unwrapLong(java.lang.Long key)`
`protected abstract void` | `updateHeader(QueueListSupport.Header header)` Writes the header back to disk after its been changed
`protected void` | `updateNextNode(java.lang.Long nextKey, java.lang.Long key)`
`protected abstract void` | `updateNode(QueueListSupport.Node node)` Updates the node
`protected void` | `updatePreviousNode(java.lang.Long previousKey, java.lang.Long key)`
`protected static java.lang.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.codehaus.activemq.service.QueueList
`clear, remove`

Field Detail

### HEAD_KEY

    protected static final java.lang.Long HEAD_KEY

Constructor Detail

### QueueListSupport

    public QueueListSupport()

Method Detail

### getFirst

    public java.lang.Object getFirst()
                              throws JMSException

  Description copied from interface: `QueueList`
  Returns the first element in this list.

  Specified by:
    `getFirst` in interface `QueueList`
  Returns:
    the first element in this list.
  Throws:
    `JMSException`

### getLast

    public java.lang.Object getLast()
                             throws JMSException

  Description copied from interface: `QueueList`
  Returns the last element in this list.

  Specified by:
    `getLast` in interface `QueueList`
  Returns:
    the last element in this list.
  Throws:
    `JMSException`

### removeFirst

    public java.lang.Object removeFirst()
                                 throws JMSException

  Description copied from interface: `QueueList`
  Removes and returns the first element from this list.

  Specified by:
    `removeFirst` in interface `QueueList`
  Returns:
    the first element from this list.
  Throws:
    `JMSException`

### removeLast

    public java.lang.Object removeLast()
                                throws JMSException

  Description copied from interface: `QueueList`
  Removes and returns the last element from this list.

  Specified by:
    `removeLast` in interface `QueueList`
  Returns:
    the last element from this list.
  Throws:
    `JMSException`

### addFirst

    public QueueListEntry addFirst(java.lang.Object value)
                            throws JMSException

  Description copied from interface: `QueueList`
  Inserts the given element at the beginning of this list.

  Specified by:
    `addFirst` in interface `QueueList`
  Parameters:
    `value` - the element to be inserted at the beginning of this list.
  Returns:
    the DefaultQueueListEntry
  Throws:
    `JMSException`

### addLast

    public QueueListEntry addLast(java.lang.Object value)
                           throws JMSException

  Description copied from interface: `QueueList`
  Appends the given element to the end of this list. (Identical in function to the `add` method; included only for consistency.)

  Specified by:
    `addLast` in interface `QueueList`
  Parameters:
    `value` - the element to be inserted at the end of this list.
  Returns:
    the DefaultQueueListEntry
  Throws:
    `JMSException`

### contains

    public boolean contains(java.lang.Object value)
                     throws JMSException

  Description copied from interface: `QueueList`
  Returns `true` if this list contains the specified element. More formally, returns `true` if and only if this list contains at least one element `e` such that `(o==null ? e==null : o.equals(e))`.

  Specified by:
    `contains` in interface `QueueList`
  Parameters:
    `value` - element whose presence in this list is to be tested.
  Returns:
    `true` if this list contains the specified element.
  Throws:
    `JMSException`

### size

    public int size()
             throws JMSException

  Description copied from interface: `QueueList`
  Returns the number of elements in this list.

  Specified by:
    `size` in interface `QueueList`
  Returns:
    the number of elements in this list.
  Throws:
    `JMSException`

### isEmpty

    public boolean isEmpty()
                    throws JMSException

  Description copied from interface: `QueueList`
  is the list empty?

  Specified by:
    `isEmpty` in interface `QueueList`
  Returns:
    true if there are no elements in the list
  Throws:
    `JMSException`

### add

    public QueueListEntry add(java.lang.Object value)
                       throws JMSException

  Description copied from interface: `QueueList`
  Appends the specified element to the end of this list.

  Specified by:
    `add` in interface `QueueList`
  Parameters:
    `value` - element to be appended to this list.
  Returns:
    the DefaultQueueListEntry
  Throws:
    `JMSException`

### get

    public java.lang.Object get(int index)
                         throws JMSException

  Description copied from interface: `QueueList`
  Returns the element at the specified position in this list.

  Specified by:
    `get` in interface `QueueList`
  Parameters:
    `index` - index of element to return.
  Returns:
    the element at the specified position in this list.
  Throws:
    `JMSException`

### set

    public java.lang.Object set(int index,
                                java.lang.Object element)
                         throws JMSException

  Description copied from interface: `QueueList`
  Replaces the element at the specified position in this list with the specified element.

  Specified by:
    `set` in interface `QueueList`
  Parameters:
    `index` - index of element to replace.
    `element` - element to be stored at the specified position.
  Returns:
    the element previously at the specified position.
  Throws:
    `JMSException`

### add

    public void add(int index,
                    java.lang.Object element)
             throws JMSException

  Description copied from interface: `QueueList`
  Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

  Specified by:
    `add` in interface `QueueList`
  Parameters:
    `index` - index at which the specified element is to be inserted.
    `element` - element to be inserted.
  Throws:
    `JMSException`

### remove

    public java.lang.Object remove(int index)
                            throws JMSException

  Description copied from interface: `QueueList`
  Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

  Specified by:
    `remove` in interface `QueueList`
  Parameters:
    `index` - the index of the element to removed.
  Returns:
    the element previously at the specified position.
  Throws:
    `JMSException`

### indexOf

    public int indexOf(java.lang.Object value)
                throws JMSException

  Description copied from interface: `QueueList`
  Returns the index in this list of the first occurrence of the specified element, or -1 if the List does not contain this element. More formally, returns the lowest index i such that `(o==null ? get(i)==null : o.equals(get(i)))`, or -1 if there is no such index.

  Specified by:
    `indexOf` in interface `QueueList`
  Parameters:
    `value` - element to search for.
  Returns:
    the index in this list of the first occurrence of the specified element, or -1 if the list does not contain this element.
  Throws:
    `JMSException`

### lastIndexOf

    public int lastIndexOf(java.lang.Object value)
                    throws JMSException

  Description copied from interface: `QueueList`
  Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element. More formally, returns the highest index i such that `(o==null ? get(i)==null : o.equals(get(i)))`, or -1 if there is no such index.

  Specified by:
    `lastIndexOf` in interface `QueueList`
  Parameters:
    `value` - element to search for.
  Returns:
    the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.
  Throws:
    `JMSException`

### getFirstEntry

    public QueueListEntry getFirstEntry()
                                 throws JMSException

  Description copied from interface: `QueueList`
  Retrieve the first entry for the linked list

  Specified by:
    `getFirstEntry` in interface `QueueList`
  Returns:
    first entry or null
  Throws:
    `JMSException`

### getLastEntry

    public QueueListEntry getLastEntry()
                                throws JMSException

  Description copied from interface: `QueueList`
  Retrieve the last entry for the linked list

  Specified by:
    `getLastEntry` in interface `QueueList`
  Returns:
    last entry or null
  Throws:
    `JMSException`

### getNextEntry

    public QueueListEntry getNextEntry(QueueListEntry entry)
                                throws JMSException

  Description copied from interface: `QueueList`
  Retrieve the next entry after this entry

  Specified by:
    `getNextEntry` in interface `QueueList`
  Parameters:
    `entry` -
  Returns:
  Throws:
    `JMSException`

### getPrevEntry

    public QueueListEntry getPrevEntry(QueueListEntry entry)
                                throws JMSException

  Description copied from interface: `QueueList`
  Retrive the previous entry after this entry

  Specified by:
    `getPrevEntry` in interface `QueueList`
  Parameters:
    `entry` -
  Returns:
  Throws:
    `JMSException`

### addBefore

    public QueueListEntry addBefore(java.lang.Object value,
                                    QueueListEntry entry)
                             throws JMSException

  Description copied from interface: `QueueList`
  Insert an Entry before this entry

  Specified by:
    `addBefore` in interface `QueueList`
  Parameters:
    `value` - the elment to insert
    `entry` - the Entry to insert the object before
  Returns:
  Throws:
    `JMSException`

### remove

    public void remove(QueueListEntry entry)
                throws JMSException

  Description copied from interface: `QueueList`
  Remove a DefaultQueueListEntry

  Specified by:
    `remove` in interface `QueueList`
  Parameters:
    `entry` - the DefaultQueueListEntry
  Throws:
    `JMSException`

### toArray

    public java.lang.Object[] toArray()
                               throws JMSException

  Description copied from interface: `QueueList`
  Returns an array containing all of the elements in this list in the correct order.

  Specified by:
    `toArray` in interface `QueueList`
  Returns:
    an array containing all of the elements in this list in the correct order.
  Throws:
    `JMSException`

### rotate

    public void rotate()
                throws JMSException

  Description copied from interface: `QueueList`
  Move the head of the list to the back of the list

  Specified by:
    `rotate` in interface `QueueList`
  Throws:
    `JMSException`

### createKey

    protected java.lang.Long createKey(QueueListSupport.Header header)
                                throws java.io.IOException,
                                       JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### removeNode

    protected boolean removeNode(QueueListSupport.Node node)
                          throws java.io.IOException,
                                 JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### getHeader

    protected abstract QueueListSupport.Header getHeader()
                                                  throws java.io.IOException,
                                                         JMSException

  Looks up the header object, lazily creating one if the current table is empty

  Returns:
  Throws:
    `java.io.IOException`
    `JMSException`

### updateHeader

    protected abstract void updateHeader(QueueListSupport.Header header)
                                  throws java.io.IOException,
                                         JMSException

  Writes the header back to disk after its been changed

  Parameters:
    `header` -
  Throws:
    `java.io.IOException`
    `JMSException`

### updateNode

    protected abstract void updateNode(QueueListSupport.Node node)
                                throws java.io.IOException,
                                       JMSException

  Updates the node

  Parameters:
    `node` -
  Throws:
    `java.io.IOException`
    `JMSException`

### getNode

    protected abstract QueueListSupport.Node getNode(java.lang.Long key)
                                              throws java.io.IOException,
                                                     JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### getNode

    protected QueueListSupport.Node getNode(int index)
                                     throws java.io.IOException,
                                            JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### getNode

    protected QueueListSupport.Node getNode(QueueListSupport.Header header,
                                            int index)
                                     throws java.io.IOException,
                                            JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### doAddLast

    protected QueueListSupport.Node doAddLast(java.lang.Object value,
                                              QueueListSupport.Header header)
                                       throws java.io.IOException,
                                              JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### updateNextNode

    protected void updateNextNode(java.lang.Long nextKey,
                                  java.lang.Long key)
                           throws java.io.IOException,
                                  JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### updatePreviousNode

    protected void updatePreviousNode(java.lang.Long previousKey,
                                      java.lang.Long key)
                               throws java.io.IOException,
                                      JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### doAddBefore

    protected QueueListSupport.Node doAddBefore(QueueListSupport.Header header,
                                                QueueListSupport.Node nextNode,
                                                java.lang.Object element)
                                         throws JMSException,
                                                java.io.IOException

  Throws:
    `JMSException`
    `java.io.IOException`

### doRemoveNode

    protected abstract void doRemoveNode(QueueListSupport.Node node)
                                  throws java.io.IOException,
                                         JMSException

  Throws:
    `java.io.IOException`
    `JMSException`

### wrapLong

    protected static java.lang.Long wrapLong(long value)

### unwrapLong

    protected static long unwrapLong(java.lang.Long key)

### createNode

    protected QueueListSupport.Node createNode()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.