org.multiverse.transactional.collections
Class AbstractBlockingDeque<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by org.multiverse.transactional.collections.AbstractBlockingDeque<E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, java.util.concurrent.BlockingDeque<E>, java.util.concurrent.BlockingQueue<E>, java.util.Deque<E>, java.util.Queue<E>
Direct Known Subclasses:
TransactionalLinkedList

public abstract class AbstractBlockingDeque<E>
extends java.util.AbstractCollection<E>
implements java.util.concurrent.BlockingDeque<E>


Constructor Summary
AbstractBlockingDeque()
           
 
Method Summary
 boolean add(E e)
           
 boolean addAll(java.util.Collection<? extends E> c)
           
 void addFirst(E e)
           
 void addLast(E e)
           
protected abstract  void doAddFirst(E e)
           
protected abstract  void doAddLast(E e)
           
protected abstract  E doRemoveFirst()
           
protected abstract  E doRemoveLast()
           
 int drainTo(java.util.Collection<? super E> c)
           
 int drainTo(java.util.Collection<? super E> c, int maxElements)
           
 E element()
           
 E getFirst()
           
 E getLast()
           
protected  boolean hasNoStorageCapacity()
           
 boolean offer(E e)
           
 boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit)
           
 boolean offerFirst(E e)
           
 boolean offerFirst(E e, long timeout, java.util.concurrent.TimeUnit unit)
           
 boolean offerLast(E e)
           
 boolean offerLast(E e, long timeout, java.util.concurrent.TimeUnit unit)
           
 E peek()
           
 E poll()
           
 E poll(long timeout, java.util.concurrent.TimeUnit unit)
           
 E pollFirst()
           
 E pollFirst(long timeout, java.util.concurrent.TimeUnit unit)
           
 E pollLast()
           
 E pollLast(long timeout, java.util.concurrent.TimeUnit unit)
           
 E pop()
           
 void push(E e)
           
 void put(E e)
           
 void putFirst(E e)
           
 void putLast(E e)
           
 E remove()
           
 E removeFirst()
           
 boolean removeFirstOccurrence(java.lang.Object o)
           
 E removeLast()
           
 boolean removeLastOccurrence(java.lang.Object o)
           
 E take()
           
 E takeFirst()
           
 E takeLast()
           
 E takeUninterruptible()
           
 
Methods inherited from class java.util.AbstractCollection
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.BlockingDeque
contains, iterator, remove, size
 
Methods inherited from interface java.util.concurrent.BlockingQueue
remainingCapacity
 
Methods inherited from interface java.util.Deque
descendingIterator, peekFirst, peekLast
 
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

AbstractBlockingDeque

public AbstractBlockingDeque()
Method Detail

offerFirst

public boolean offerFirst(E e,
                          long timeout,
                          java.util.concurrent.TimeUnit unit)
                   throws java.lang.InterruptedException
Specified by:
offerFirst in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

offerLast

public boolean offerLast(E e,
                         long timeout,
                         java.util.concurrent.TimeUnit unit)
                  throws java.lang.InterruptedException
Specified by:
offerLast in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

addAll

public boolean addAll(java.util.Collection<? extends E> c)
Specified by:
addAll in interface java.util.Collection<E>
Overrides:
addAll in class java.util.AbstractCollection<E>

addFirst

public void addFirst(E e)
Specified by:
addFirst in interface java.util.concurrent.BlockingDeque<E>
Specified by:
addFirst in interface java.util.Deque<E>

doAddFirst

protected abstract void doAddFirst(E e)

addLast

public void addLast(E e)
Specified by:
addLast in interface java.util.concurrent.BlockingDeque<E>
Specified by:
addLast in interface java.util.Deque<E>

offerFirst

public boolean offerFirst(E e)
Specified by:
offerFirst in interface java.util.concurrent.BlockingDeque<E>
Specified by:
offerFirst in interface java.util.Deque<E>

offerLast

public boolean offerLast(E e)
Specified by:
offerLast in interface java.util.concurrent.BlockingDeque<E>
Specified by:
offerLast in interface java.util.Deque<E>

doAddLast

protected abstract void doAddLast(E e)

putFirst

public void putFirst(E e)
              throws java.lang.InterruptedException
Specified by:
putFirst in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

putLast

public void putLast(E e)
             throws java.lang.InterruptedException
Specified by:
putLast in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

takeFirst

public E takeFirst()
            throws java.lang.InterruptedException
Specified by:
takeFirst in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

doRemoveFirst

protected abstract E doRemoveFirst()

takeLast

public E takeLast()
           throws java.lang.InterruptedException
Specified by:
takeLast in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

doRemoveLast

protected abstract E doRemoveLast()

removeFirst

public E removeFirst()
Specified by:
removeFirst in interface java.util.Deque<E>

removeLast

public E removeLast()
Specified by:
removeLast in interface java.util.Deque<E>

removeFirstOccurrence

public boolean removeFirstOccurrence(java.lang.Object o)
Specified by:
removeFirstOccurrence in interface java.util.concurrent.BlockingDeque<E>
Specified by:
removeFirstOccurrence in interface java.util.Deque<E>

removeLastOccurrence

public boolean removeLastOccurrence(java.lang.Object o)
Specified by:
removeLastOccurrence in interface java.util.concurrent.BlockingDeque<E>
Specified by:
removeLastOccurrence in interface java.util.Deque<E>

add

public boolean add(E e)
Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.concurrent.BlockingDeque<E>
Specified by:
add in interface java.util.concurrent.BlockingQueue<E>
Specified by:
add in interface java.util.Deque<E>
Specified by:
add in interface java.util.Queue<E>
Overrides:
add in class java.util.AbstractCollection<E>

hasNoStorageCapacity

protected boolean hasNoStorageCapacity()

offer

public boolean offer(E e)
Specified by:
offer in interface java.util.concurrent.BlockingDeque<E>
Specified by:
offer in interface java.util.concurrent.BlockingQueue<E>
Specified by:
offer in interface java.util.Deque<E>
Specified by:
offer in interface java.util.Queue<E>

put

public void put(E e)
         throws java.lang.InterruptedException
Specified by:
put in interface java.util.concurrent.BlockingDeque<E>
Specified by:
put in interface java.util.concurrent.BlockingQueue<E>
Throws:
java.lang.InterruptedException

remove

public E remove()
Specified by:
remove in interface java.util.concurrent.BlockingDeque<E>
Specified by:
remove in interface java.util.Deque<E>
Specified by:
remove in interface java.util.Queue<E>

poll

public E poll()
Specified by:
poll in interface java.util.concurrent.BlockingDeque<E>
Specified by:
poll in interface java.util.Deque<E>
Specified by:
poll in interface java.util.Queue<E>

pollFirst

public E pollFirst()
Specified by:
pollFirst in interface java.util.Deque<E>

pollLast

public E pollLast()
Specified by:
pollLast in interface java.util.Deque<E>

pollFirst

public E pollFirst(long timeout,
                   java.util.concurrent.TimeUnit unit)
            throws java.lang.InterruptedException
Specified by:
pollFirst in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

pollLast

public E pollLast(long timeout,
                  java.util.concurrent.TimeUnit unit)
           throws java.lang.InterruptedException
Specified by:
pollLast in interface java.util.concurrent.BlockingDeque<E>
Throws:
java.lang.InterruptedException

offer

public boolean offer(E e,
                     long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException
Specified by:
offer in interface java.util.concurrent.BlockingDeque<E>
Specified by:
offer in interface java.util.concurrent.BlockingQueue<E>
Throws:
java.lang.InterruptedException

poll

public E poll(long timeout,
              java.util.concurrent.TimeUnit unit)
       throws java.lang.InterruptedException
Specified by:
poll in interface java.util.concurrent.BlockingDeque<E>
Specified by:
poll in interface java.util.concurrent.BlockingQueue<E>
Throws:
java.lang.InterruptedException

take

public E take()
       throws java.lang.InterruptedException
Specified by:
take in interface java.util.concurrent.BlockingDeque<E>
Specified by:
take in interface java.util.concurrent.BlockingQueue<E>
Throws:
java.lang.InterruptedException

takeUninterruptible

public E takeUninterruptible()

element

public E element()
Specified by:
element in interface java.util.concurrent.BlockingDeque<E>
Specified by:
element in interface java.util.Deque<E>
Specified by:
element in interface java.util.Queue<E>

peek

public E peek()
Specified by:
peek in interface java.util.concurrent.BlockingDeque<E>
Specified by:
peek in interface java.util.Deque<E>
Specified by:
peek in interface java.util.Queue<E>

push

public void push(E e)
Specified by:
push in interface java.util.concurrent.BlockingDeque<E>
Specified by:
push in interface java.util.Deque<E>

drainTo

public int drainTo(java.util.Collection<? super E> c)
Specified by:
drainTo in interface java.util.concurrent.BlockingQueue<E>

drainTo

public int drainTo(java.util.Collection<? super E> c,
                   int maxElements)
Specified by:
drainTo in interface java.util.concurrent.BlockingQueue<E>

pop

public E pop()
Specified by:
pop in interface java.util.Deque<E>

getFirst

public E getFirst()
Specified by:
getFirst in interface java.util.Deque<E>

getLast

public E getLast()
Specified by:
getLast in interface java.util.Deque<E>


Copyright © 2008-2010 Multiverse. All Rights Reserved.