org.terracotta.collections
Class ConcurrentBlockingQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
org.terracotta.collections.ConcurrentBlockingQueue<E>
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>
public class ConcurrentBlockingQueue<E>
- extends AbstractQueue<E>
- implements BlockingQueue<E>, Serializable
- See Also:
- Serialized Form
ConcurrentBlockingQueue
public ConcurrentBlockingQueue()
- Creates a LinkedBlockingQueue with a capacity of
Integer.MAX_VALUE.
ConcurrentBlockingQueue
public ConcurrentBlockingQueue(int capacity)
- Creates a LinkedBlockingQueue with the given (fixed) capacity.
- Parameters:
capacity - the capacity of this queue.
- Throws:
IllegalArgumentException - if capacity is not greater than zero.
ConcurrentBlockingQueue
public ConcurrentBlockingQueue(Collection<? extends E> c)
- Creates a LinkedBlockingQueue with a capacity of
Integer.MAX_VALUE, initially containing the
elements of the given collection, added in traversal order of the collection's iterator.
- Parameters:
c - the collection of elements to initially contain
- Throws:
NullPointerException - if c or any element within it is null
init
protected void init()
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in class AbstractCollection<E>
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacity in interface BlockingQueue<E>
size
public int size()
- Specified by:
size in interface Collection<E>- Specified by:
size in class AbstractCollection<E>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface BlockingQueue<E>- Overrides:
remove in class AbstractCollection<E>
peek
public E peek()
- Specified by:
peek in interface Queue<E>
offer
public boolean offer(E o)
- Specified by:
offer in interface BlockingQueue<E>- Specified by:
offer in interface Queue<E>
offer
public boolean offer(E o,
long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
offer in interface BlockingQueue<E>
- Throws:
InterruptedException
put
public void put(E o)
throws InterruptedException
- Specified by:
put in interface BlockingQueue<E>
- Throws:
InterruptedException
__tc_take
public E __tc_take()
__tc_put
public void __tc_put(E o)
take
public E take()
throws InterruptedException
- Specified by:
take in interface BlockingQueue<E>
- Throws:
InterruptedException
poll
public E poll(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
poll in interface BlockingQueue<E>
- Throws:
InterruptedException
poll
public E poll()
- Specified by:
poll in interface Queue<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Overrides:
clear in class AbstractQueue<E>
drainTo
public int drainTo(Collection<? super E> c)
- Specified by:
drainTo in interface BlockingQueue<E>
drainTo
public int drainTo(Collection<? super E> c,
int maxElements)
- Specified by:
drainTo in interface BlockingQueue<E>
getCapacity
public int getCapacity()
- Returns the maximum capacity of this queue.
- Returns:
- the queue capacity
Copyright © 2015 Terracotta, Inc.. All Rights Reserved.