org.norther.tammi.acorn.util.concurrent
Class BoundedQueue<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.ArrayBlockingQueue<E>
              extended by org.norther.tammi.acorn.util.concurrent.BoundedQueue<E>
Type Parameters:
E - the element type.
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>
Direct Known Subclasses:
ThresholdQueue

public class BoundedQueue<E>
extends ArrayBlockingQueue<E>

An array-based bounded blocking queue class.

Version:
$Id: BoundedQueue.java,v 1.6 2009/09/28 15:08:49 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
BoundedQueue(int capacity)
          Constructs a new queue with the specified capacity.
BoundedQueue(int capacity, boolean fair)
          Creates a new queue with the specified capacity and access policy.
BoundedQueue(int capacity, boolean fair, Collection<? extends E> c)
          Creates a new queue with the specified capacity, access policy and an initial collection.
BoundedQueue(int capacity, Collection<? extends E> c)
          Creates a new queue with with the specified capacity and an initial collection.
 
Method Summary
 
Methods inherited from class java.util.concurrent.ArrayBlockingQueue
add, clear, contains, drainTo, drainTo, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, size, take, toArray, toArray, toString
 
Methods inherited from class java.util.AbstractQueue
addAll, element, remove
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

Constructor Detail

BoundedQueue

public BoundedQueue(int capacity)
Constructs a new queue with the specified capacity.

Parameters:
capacity - the capacity.

BoundedQueue

public BoundedQueue(int capacity,
                    Collection<? extends E> c)
Creates a new queue with with the specified capacity and an initial collection.

Parameters:
capacity - the capacity.
c - the initial collection of items.

BoundedQueue

public BoundedQueue(int capacity,
                    boolean fair)
Creates a new queue with the specified capacity and access policy.

Parameters:
capacity - the capacity.
fair - true for FIFO, false for unspecified.

BoundedQueue

public BoundedQueue(int capacity,
                    boolean fair,
                    Collection<? extends E> c)
Creates a new queue with the specified capacity, access policy and an initial collection.

Parameters:
capacity - the capacity.
fair - true for FIFO, false for unspecified.
c - the initial collection of items.


Copyright © 2004 The Norther Organization. All rights reserved.