org.apache.qpid.util
Class ConcurrentLinkedMessageQueueAtomicSize<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.ConcurrentLinkedQueue<E>
              extended by org.apache.qpid.util.ConcurrentLinkedQueueAtomicSize<E>
                  extended by org.apache.qpid.util.ConcurrentLinkedMessageQueueAtomicSize<E>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, Queue<E>, MessageQueue<E>

public class ConcurrentLinkedMessageQueueAtomicSize<E>
extends ConcurrentLinkedQueueAtomicSize<E>
implements MessageQueue<E>

See Also:
Serialized Form

Field Summary
protected  Queue<E> _messageHead
           
protected  AtomicInteger _messageHeadSize
           
 
Fields inherited from class org.apache.qpid.util.ConcurrentLinkedQueueAtomicSize
_size
 
Constructor Summary
ConcurrentLinkedMessageQueueAtomicSize()
           
 
Method Summary
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> o)
           
 E element()
           
 int headSize()
           
 boolean isEmpty()
           
 Iterator<E> iterator()
           
 E peek()
           
 E poll()
           
 boolean pushHead(E o)
          Inserts the specified element into this queue, if possible.
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
           
 Object[] toArray()
           
 
Methods inherited from class org.apache.qpid.util.ConcurrentLinkedQueueAtomicSize
offer
 
Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue
add, toArray
 
Methods inherited from class java.util.AbstractQueue
addAll, remove
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Queue
add, offer, remove
 
Methods inherited from interface java.util.Collection
addAll, equals, hashCode, toArray
 

Field Detail

_messageHead

protected Queue<E> _messageHead

_messageHeadSize

protected AtomicInteger _messageHeadSize
Constructor Detail

ConcurrentLinkedMessageQueueAtomicSize

public ConcurrentLinkedMessageQueueAtomicSize()
Method Detail

size

public int size()
Specified by:
size in interface Collection<E>
Overrides:
size in class ConcurrentLinkedQueueAtomicSize<E>

headSize

public int headSize()

poll

public E poll()
Specified by:
poll in interface Queue<E>
Overrides:
poll in class ConcurrentLinkedQueueAtomicSize<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Overrides:
remove in class ConcurrentLinkedQueueAtomicSize<E>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>
Overrides:
removeAll in class AbstractCollection<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<E>
Overrides:
isEmpty in class ConcurrentLinkedQueue<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>
Overrides:
clear in class AbstractQueue<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Overrides:
contains in class ConcurrentLinkedQueue<E>

containsAll

public boolean containsAll(Collection<?> o)
Specified by:
containsAll in interface Collection<E>
Overrides:
containsAll in class AbstractCollection<E>

element

public E element()
Specified by:
element in interface Queue<E>
Overrides:
element in class AbstractQueue<E>

peek

public E peek()
Specified by:
peek in interface Queue<E>
Overrides:
peek in class ConcurrentLinkedQueue<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Overrides:
iterator in class ConcurrentLinkedQueue<E>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>
Overrides:
retainAll in class AbstractCollection<E>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>
Overrides:
toArray in class ConcurrentLinkedQueue<E>

pushHead

public boolean pushHead(E o)
Description copied from interface: MessageQueue
Inserts the specified element into this queue, if possible. When using queues that may impose insertion restrictions (for example capacity bounds), method offer is generally preferable to method Collection.add(E), which can fail to insert an element only by throwing an exception.

Specified by:
pushHead in interface MessageQueue<E>
Parameters:
o - The element to insert.
Returns:
true if it was possible to add the element to this queue, else false


Licensed to the Apache Software Foundation