Public Member Functions | Private Attributes
org.ros.concurrent.CircularBlockingDeque< T > Class Reference

List of all members.

Public Member Functions

boolean addFirst (T entry)
boolean addLast (T entry)
 CircularBlockingDeque (int capacity)
boolean isEmpty ()
Iterator< T > iterator ()
peekFirst ()
peekLast ()
takeFirst () throws InterruptedException
takeLast () throws InterruptedException

Private Attributes

final T[] deque
int length
final int limit
final Object mutex
int start

Detailed Description

A deque that removes head or tail elements when the number of elements exceeds the limit and blocks on takeFirst() and takeLast() when there are no elements available.

Author:
damonkohler@google.com (Damon Kohler)

Definition at line 29 of file CircularBlockingDeque.java.


Constructor & Destructor Documentation

org.ros.concurrent.CircularBlockingDeque< T >.CircularBlockingDeque ( int  capacity) [inline]
Parameters:
capacitythe maximum number of elements allowed in the queue

Definition at line 55 of file CircularBlockingDeque.java.


Member Function Documentation

boolean org.ros.concurrent.CircularBlockingDeque< T >.addFirst ( entry) [inline]

Adds the specified entry to the tail of the queue, overwriting older entries if necessary.

Parameters:
entrythe entry to add
Returns:
 true 

Definition at line 92 of file CircularBlockingDeque.java.

boolean org.ros.concurrent.CircularBlockingDeque< T >.addLast ( entry) [inline]

Adds the specified entry to the tail of the queue, overwriting older entries if necessary.

Parameters:
entrythe entry to add
Returns:
 true 

Definition at line 71 of file CircularBlockingDeque.java.

boolean org.ros.concurrent.CircularBlockingDeque< T >.isEmpty ( ) [inline]

Definition at line 183 of file CircularBlockingDeque.java.

Iterator<T> org.ros.concurrent.CircularBlockingDeque< T >.iterator ( ) [inline]

Returns an iterator over the queue.

Note that this is not thread-safe and that Iterator#remove() is unsupported.

See also:
java.lang.Iterable::iterator()

Definition at line 196 of file CircularBlockingDeque.java.

T org.ros.concurrent.CircularBlockingDeque< T >.peekFirst ( ) [inline]

Retrieves, but does not remove, the head of this queue, returning

 null 

if this queue is empty.

Returns:
the head of this queue, or
 null 
if this queue is empty

Definition at line 137 of file CircularBlockingDeque.java.

T org.ros.concurrent.CircularBlockingDeque< T >.peekLast ( ) [inline]

Retrieves, but does not remove, the tail of this queue, returning

 null 

if this queue is empty.

Returns:
the tail of this queue, or
 null 
if this queue is empty

Definition at line 174 of file CircularBlockingDeque.java.

T org.ros.concurrent.CircularBlockingDeque< T >.takeFirst ( ) throws InterruptedException [inline]

Retrieves the head of the queue, blocking if necessary until an entry is available.

Returns:
the head of the queue
Exceptions:
InterruptedException

Definition at line 115 of file CircularBlockingDeque.java.

T org.ros.concurrent.CircularBlockingDeque< T >.takeLast ( ) throws InterruptedException [inline]

Retrieves the tail of the queue, blocking if necessary until an entry is available.

Returns:
the tail of the queue
Exceptions:
InterruptedException

Definition at line 153 of file CircularBlockingDeque.java.


Member Data Documentation

final T [] org.ros.concurrent.CircularBlockingDeque< T >.deque [private]

Definition at line 31 of file CircularBlockingDeque.java.

int org.ros.concurrent.CircularBlockingDeque< T >.length [private]

The number of entries in the queue.

Definition at line 48 of file CircularBlockingDeque.java.

final int org.ros.concurrent.CircularBlockingDeque< T >.limit [private]

The maximum number of entries in the queue.

Definition at line 37 of file CircularBlockingDeque.java.

final Object org.ros.concurrent.CircularBlockingDeque< T >.mutex [private]

Definition at line 32 of file CircularBlockingDeque.java.

int org.ros.concurrent.CircularBlockingDeque< T >.start [private]

Points to the next entry that will be returned by takeFirst() unless isEmpty().

Definition at line 43 of file CircularBlockingDeque.java.


The documentation for this class was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:50