com.waveset.util
Class DoubleBufferQueue

java.lang.Object
  extended bycom.waveset.util.BlockingQueueIterator
      extended bycom.waveset.util.DoubleBufferQueue

public class DoubleBufferQueue
extends BlockingQueueIterator

The DoubleBufferQueue class encapsulates the logic required to allow double buffering of objects coming from a 'supplier' Since the queue is the same length as the expected buffer size, the queue acts as one buffer, with the second buffer existing inside the BufferedSupplier.


Nested Class Summary
 
Nested classes inherited from class com.waveset.util.BlockingQueueIterator
BlockingQueueIterator.BQIData
 
Field Summary
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.util.BlockingQueueIterator
END_OF_DATA
 
Constructor Summary
DoubleBufferQueue(Supplier supplier)
           
 
Method Summary
 void close()
          Force an interrupt on the supplier thread, in order to close down the input source.
protected  void finalize()
           
protected  Supplier getSupplier()
           
protected  java.lang.Thread getThread()
           
 
Methods inherited from class com.waveset.util.BlockingQueueIterator
getQueue, hasMoreElements, nextElement
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

DoubleBufferQueue

public DoubleBufferQueue(Supplier supplier)
Method Detail

close

public void close()
Force an interrupt on the supplier thread, in order to close down the input source.

Overrides:
close in class BlockingQueueIterator

getSupplier

protected Supplier getSupplier()

getThread

protected java.lang.Thread getThread()

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable