Package com.db4o.foundation
Class DelegatingBlockingQueue<T>
- java.lang.Object
- 
- com.db4o.foundation.DelegatingBlockingQueue<T>
 
- 
- All Implemented Interfaces:
- BlockingQueue4<T>,- Queue4<T>
 
 public class DelegatingBlockingQueue<T> extends java.lang.Object implements BlockingQueue4<T> 
- 
- 
Constructor SummaryConstructors Constructor Description DelegatingBlockingQueue(BlockingQueue4<T> queue)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T obj)intdrainTo(Collection4<T> list)Removes all the available elements in the queue to the colletion passed as argument.booleanhasNext()Iterator4iterator()Tnext()Tnext(long timeout)Returns the next queued item or waits for it to be available for the maximum oftimeoutmiliseconds.TnextMatching(Predicate4<T> condition)Returns the next object in the queue that matches the specified condition.voidstop()
 
- 
- 
- 
Constructor Detail- 
DelegatingBlockingQueuepublic DelegatingBlockingQueue(BlockingQueue4<T> queue) 
 
- 
 - 
Method Detail- 
nextpublic T next(long timeout) throws BlockingQueueStoppedException Description copied from interface:BlockingQueue4Returns the next queued item or waits for it to be available for the maximum of timeoutmiliseconds.- Specified by:
- nextin interface- BlockingQueue4<T>
- Parameters:
- timeout- maximum time to wait for the next avilable item in miliseconds
- Returns:
- the next item or nulliftimeoutis reached
- Throws:
- BlockingQueueStoppedException- if the- BlockingQueue4.stop()is called.
 
 - 
nextMatchingpublic T nextMatching(Predicate4<T> condition) Description copied from interface:Queue4Returns the next object in the queue that matches the specified condition. The operation is always NON-BLOCKING.- Specified by:
- nextMatchingin interface- Queue4<T>
- Parameters:
- condition- the object must satisfy to be returned
- Returns:
- the object satisfying the condition or null if none does
 
 - 
stoppublic void stop() - Specified by:
- stopin interface- BlockingQueue4<T>
 
 - 
drainTopublic int drainTo(Collection4<T> list) Description copied from interface:BlockingQueue4Removes all the available elements in the queue to the colletion passed as argument. It will block until at least one element is available. - Specified by:
- drainToin interface- BlockingQueue4<T>
- Returns:
- the number of elements added to the list.
 
 
- 
 
-