| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | PrimitiveArrayBuilder.
For actual buffering beyond the current buffer, we can actually use shared class which only deals with opaque "untyped" chunks. |
| Modifier and Type | Field and Description |
|---|---|
| protected int | _bufferedEntryCount
Number of total buffered entries in this buffer, counting all instances
within linked list formed by following |
| protected PrimitiveArrayBuilder. | |
| protected PrimitiveArrayBuilder. | |
| protected T | |
| pack-priv static final int | INITIAL_CHUNK_SIZE
Let's start with small chunks; typical usage is for small arrays anyway. |
| pack-priv static final int | MAX_CHUNK_SIZE
Let's limit maximum size of chunks we use; helps avoid excessive allocation overhead for huge data sets. |
| pack-priv static final int | SMALL_CHUNK_SIZE
Also: let's expand by doubling up until 64k chunks (which is 16k entries for 32-bit machines) |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract T | |
| protected void | |
| public final T | |
| public int | |
| public T | |
| public T |
| _bufferedEntryCount | back to summary |
|---|---|
| protected int _bufferedEntryCount Number of total buffered entries in this buffer, counting all instances
within linked list formed by following | |
| _bufferHead | back to summary |
|---|---|
| protected PrimitiveArrayBuilder. | |
| _bufferTail | back to summary |
|---|---|
| protected PrimitiveArrayBuilder. | |
| _freeBuffer | back to summary |
|---|---|
| protected T _freeBuffer | |
| INITIAL_CHUNK_SIZE | back to summary |
|---|---|
| pack-priv static final int INITIAL_CHUNK_SIZE Let's start with small chunks; typical usage is for small arrays anyway. | |
| MAX_CHUNK_SIZE | back to summary |
|---|---|
| pack-priv static final int MAX_CHUNK_SIZE Let's limit maximum size of chunks we use; helps avoid excessive allocation overhead for huge data sets. For now, let's limit to quarter million entries, 1 meg chunks for 32-bit machines. | |
| SMALL_CHUNK_SIZE | back to summary |
|---|---|
| pack-priv static final int SMALL_CHUNK_SIZE Also: let's expand by doubling up until 64k chunks (which is 16k entries for 32-bit machines) | |
| PrimitiveArrayBuilder | back to summary |
|---|---|
| protected PrimitiveArrayBuilder() | |
| _constructArray | back to summary |
|---|---|
| protected abstract T _constructArray(int len) | |
| _reset | back to summary |
|---|---|
| protected void _reset() | |
| appendCompletedChunk | back to summary |
|---|---|
public final T appendCompletedChunk(T fullChunk, int fullChunkLength)
| |
| bufferedSize | back to summary |
|---|---|
| public int bufferedSize() | |
| completeAndClearBuffer | back to summary |
|---|---|
| public T completeAndClearBuffer(T lastChunk, int lastChunkEntries) | |
| resetAndStart | back to summary |
|---|---|
| public T resetAndStart() | |
java.lang.System#arraycopy does not
take type; hence we can implement some aspects of primitive data
handling in generic fashion.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final T | _data
Data stored in this node. |
| pack-priv final int | _dataLength
Number entries in the (untyped) array. |
| pack-priv PrimitiveArrayBuilder. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public T | |
| public void | |
| public PrimitiveArrayBuilder. |
| _data | back to summary |
|---|---|
| pack-priv final T _data Data stored in this node. | |
| _dataLength | back to summary |
|---|---|
| pack-priv final int _dataLength Number entries in the (untyped) array. Offset is assumed to be 0. | |
| _next | back to summary |
|---|---|
| pack-priv PrimitiveArrayBuilder. | |
| Node | back to summary |
|---|---|
| public Node(T data, int dataLen) | |
| copyData | back to summary |
|---|---|
| public int copyData(T dst, int ptr) | |
| getData | back to summary |
|---|---|
| public T getData() | |
| linkNext | back to summary |
|---|---|
| public void linkNext(PrimitiveArrayBuilder. | |
| next | back to summary |
|---|---|
| public PrimitiveArrayBuilder. | |