com.bigdata.relation.accesspath
Class UnsynchronizedArrayBuffer<E>

java.lang.Object
  extended by com.bigdata.relation.accesspath.AbstractUnsynchronizedArrayBuffer<E>
      extended by com.bigdata.relation.accesspath.UnsynchronizedArrayBuffer<E>
All Implemented Interfaces:
IBuffer<E>

public class UnsynchronizedArrayBuffer<E>
extends AbstractUnsynchronizedArrayBuffer<E>

An unsynchronized buffer backed by a fixed capacity array that migrates references onto the caller's buffer (which is normally thread-safe) using IBuffer#add(int).

This implementation is NOT thread-safe.

Version:
$Id: UnsynchronizedArrayBuffer.java 6130 2012-03-15 10:31:25Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
UnsynchronizedArrayBuffer(IBuffer<E[]> target, Class<? extends E> cls, int capacity)
           
UnsynchronizedArrayBuffer(IBuffer<E[]> target, int capacity, Class<? extends E> cls, IElementFilter<E> filter)
           
 
Method Summary
protected  void handleChunk(E[] chunk)
          Add the chunk to the target buffer.
 
Methods inherited from class com.bigdata.relation.accesspath.AbstractUnsynchronizedArrayBuffer
accept, add, add2, flush, isEmpty, overflow, reset, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsynchronizedArrayBuffer

public UnsynchronizedArrayBuffer(IBuffer<E[]> target,
                                 Class<? extends E> cls,
                                 int capacity)
Parameters:
target - The target buffer onto which the elements will be flushed.
cls - The component type of the backing array.
capacity - The capacity of the backing buffer.

UnsynchronizedArrayBuffer

public UnsynchronizedArrayBuffer(IBuffer<E[]> target,
                                 int capacity,
                                 Class<? extends E> cls,
                                 IElementFilter<E> filter)
Parameters:
target - The target buffer onto which chunks of elements will be flushed.
cls - The component type of the backing array.
capacity - The capacity of the backing buffer.
filter - Filter to keep elements out of the buffer (optional).
Method Detail

handleChunk

protected final void handleChunk(E[] chunk)
Add the chunk to the target buffer.

Specified by:
handleChunk in class AbstractUnsynchronizedArrayBuffer<E>
Parameters:
chunk - A chunk.


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.