|
|||||||||
| Home >> All >> org >> activemq >> service >> [ impl overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.activemq.service.impl
Class DefaultQueueList

java.lang.Objectorg.activemq.service.impl.DefaultQueueList
- All Implemented Interfaces:
- java.lang.Cloneable, org.activemq.service.QueueList, java.io.Serializable
- public final class DefaultQueueList
- extends java.lang.Object
- implements org.activemq.service.QueueList, java.lang.Cloneable, java.io.Serializable
- extends java.lang.Object
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).
- Version:
- $Revision: 1.1.1.1 $
| Field Summary | |
private DefaultQueueListEntry |
header
|
private static long |
serialVersionUID
|
private int |
size
|
| 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. |
org.activemq.service.QueueListEntry |
add(java.lang.Object o)
Appends the specified element to the end of this list. |
org.activemq.service.QueueListEntry |
addAllBefore(java.util.Collection c,
org.activemq.service.QueueListEntry node)
|
org.activemq.service.QueueListEntry |
addAllFirst(java.util.Collection c)
|
org.activemq.service.QueueListEntry |
addBefore(java.lang.Object o,
org.activemq.service.QueueListEntry node)
Insert an Entry before this entry |
org.activemq.service.QueueListEntry |
addFirst(java.lang.Object o)
Inserts the given element at the beginning of this list. |
org.activemq.service.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. |
org.activemq.service.QueueListEntry |
getFirstEntry()
Retrieve the first entry for the linked list |
java.lang.Object |
getLast()
Returns the last element in this list. |
org.activemq.service.QueueListEntry |
getLastEntry()
Retrieve the last entry for the linked list |
org.activemq.service.QueueListEntry |
getNextEntry(org.activemq.service.QueueListEntry node)
Retrieve the next entry after this entry |
org.activemq.service.QueueListEntry |
getPrevEntry(org.activemq.service.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(org.activemq.service.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()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
header
private transient DefaultQueueListEntry header
size
private transient int size
| Constructor Detail |
DefaultQueueList
public DefaultQueueList()
- Constructs an empty list.
| Method Detail |
getFirst
public java.lang.Object getFirst()
- Description copied from interface:
org.activemq.service.QueueList - Returns the first element in this list.
- Specified by:
getFirstin interfaceorg.activemq.service.QueueList
getLast
public java.lang.Object getLast()
- Description copied from interface:
org.activemq.service.QueueList - Returns the last element in this list.
- Specified by:
getLastin interfaceorg.activemq.service.QueueList
removeFirst
public java.lang.Object removeFirst()
- remove the first object from the list
- Specified by:
removeFirstin interfaceorg.activemq.service.QueueList
rotate
public void rotate()
- move the first object to the back of the list
- Specified by:
rotatein interfaceorg.activemq.service.QueueList
removeLast
public java.lang.Object removeLast()
- remove the last object
- Specified by:
removeLastin interfaceorg.activemq.service.QueueList
addAllFirst
public org.activemq.service.QueueListEntry addAllFirst(java.util.Collection c)
addFirst
public org.activemq.service.QueueListEntry addFirst(java.lang.Object o)
- Description copied from interface:
org.activemq.service.QueueList - Inserts the given element at the beginning of this list.
- Specified by:
addFirstin interfaceorg.activemq.service.QueueList
addLast
public org.activemq.service.QueueListEntry addLast(java.lang.Object o)
- Description copied from interface:
org.activemq.service.QueueList - Appends the given element to the end of this list. (Identical in function to the add method; included
only for consistency.)
- Specified by:
addLastin interfaceorg.activemq.service.QueueList
contains
public boolean contains(java.lang.Object o)
- Description copied from interface:
org.activemq.service.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:
containsin interfaceorg.activemq.service.QueueList
size
public int size()
- Description copied from interface:
org.activemq.service.QueueList - Returns the number of elements in this list.
- Specified by:
sizein interfaceorg.activemq.service.QueueList
isEmpty
public boolean isEmpty()
- Description copied from interface:
org.activemq.service.QueueList - is the list empty?
- Specified by:
isEmptyin interfaceorg.activemq.service.QueueList
add
public org.activemq.service.QueueListEntry add(java.lang.Object o)
- Description copied from interface:
org.activemq.service.QueueList - Appends the specified element to the end of this list.
- Specified by:
addin interfaceorg.activemq.service.QueueList
remove
public boolean remove(java.lang.Object o)
- Description copied from interface:
org.activemq.service.QueueList - Removes the first occurrence of the specified element in this list. If the list does not contain the element, it
is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i)))
(if such an element exists).
- Specified by:
removein interfaceorg.activemq.service.QueueList
clear
public void clear()
- Description copied from interface:
org.activemq.service.QueueList - Removes all of the elements from this list.
- Specified by:
clearin interfaceorg.activemq.service.QueueList
get
public java.lang.Object get(int index)
- Description copied from interface:
org.activemq.service.QueueList - Returns the element at the specified position in this list.
- Specified by:
getin interfaceorg.activemq.service.QueueList
get
public java.lang.Object get(java.lang.Object obj)
- get the object from the queue
set
public java.lang.Object set(int index, java.lang.Object element)
- Description copied from interface:
org.activemq.service.QueueList - Replaces the element at the specified position in this list with the specified element.
- Specified by:
setin interfaceorg.activemq.service.QueueList
add
public void add(int index,
java.lang.Object element)
- Description copied from interface:
org.activemq.service.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:
addin interfaceorg.activemq.service.QueueList
remove
public java.lang.Object remove(int index)
- Description copied from interface:
org.activemq.service.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:
removein interfaceorg.activemq.service.QueueList
entry
public DefaultQueueListEntry entry(int index)
indexOf
public int indexOf(java.lang.Object o)
- Description copied from interface:
org.activemq.service.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:
indexOfin interfaceorg.activemq.service.QueueList
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Description copied from interface:
org.activemq.service.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:
lastIndexOfin interfaceorg.activemq.service.QueueList
getFirstEntry
public org.activemq.service.QueueListEntry getFirstEntry()
- Description copied from interface:
org.activemq.service.QueueList - Retrieve the first entry for the linked list
- Specified by:
getFirstEntryin interfaceorg.activemq.service.QueueList
getLastEntry
public org.activemq.service.QueueListEntry getLastEntry()
- Description copied from interface:
org.activemq.service.QueueList - Retrieve the last entry for the linked list
- Specified by:
getLastEntryin interfaceorg.activemq.service.QueueList
getNextEntry
public org.activemq.service.QueueListEntry getNextEntry(org.activemq.service.QueueListEntry node)
- Description copied from interface:
org.activemq.service.QueueList - Retrieve the next entry after this entry
- Specified by:
getNextEntryin interfaceorg.activemq.service.QueueList
getPrevEntry
public org.activemq.service.QueueListEntry getPrevEntry(org.activemq.service.QueueListEntry node)
- Description copied from interface:
org.activemq.service.QueueList - Retrive the previous entry after this entry
- Specified by:
getPrevEntryin interfaceorg.activemq.service.QueueList
addBefore
public org.activemq.service.QueueListEntry addBefore(java.lang.Object o, org.activemq.service.QueueListEntry node)
- Description copied from interface:
org.activemq.service.QueueList - Insert an Entry before this entry
- Specified by:
addBeforein interfaceorg.activemq.service.QueueList
addAllBefore
public org.activemq.service.QueueListEntry addAllBefore(java.util.Collection c, org.activemq.service.QueueListEntry node)
remove
public void remove(org.activemq.service.QueueListEntry node)
- Description copied from interface:
org.activemq.service.QueueList - Remove a DefaultQueueListEntry
- Specified by:
removein interfaceorg.activemq.service.QueueList
clone
public java.lang.Object clone()
- Returns a shallow copy of this DefaultQueueList. (The elements themselves are not cloned.)
toArray
public java.lang.Object[] toArray()
- Description copied from interface:
org.activemq.service.QueueList - Returns an array containing all of the elements in this list in the correct order.
- Specified by:
toArrayin interfaceorg.activemq.service.QueueList
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
|
|||||||||
| Home >> All >> org >> activemq >> service >> [ impl overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.activemq.service.impl.DefaultQueueList