public class FastBooleanBuffer
extends java.lang.Object
boolean buffer.
This buffer implementation does not store all data
in single array, but in array of chunks.| Constructor and Description |
|---|
FastBooleanBuffer()
Creates a new
boolean buffer. |
FastBooleanBuffer(int size)
Creates a new
boolean buffer, with a buffer capacity of
the specified size, in bytes. |
| Modifier and Type | Method and Description |
|---|---|
FastBooleanBuffer |
append(boolean element)
Appends single
boolean to buffer. |
FastBooleanBuffer |
append(boolean[] array)
Appends
boolean array to buffer. |
FastBooleanBuffer |
append(boolean[] array,
int off,
int len)
Appends
boolean array to buffer. |
FastBooleanBuffer |
append(FastBooleanBuffer buff)
Appends another fast buffer to this one.
|
boolean[] |
array(int index)
Returns
boolean inner array chunk at given index. |
void |
clear()
Resets the buffer content.
|
boolean |
get(int index)
Returns
boolean element at given index. |
int |
index()
Returns current index of inner
boolean array chunk. |
boolean |
isEmpty()
Tests if this buffer has no elements.
|
int |
offset()
Returns the offset of last used element in current inner array chunk.
|
int |
size()
Returns buffer size.
|
boolean[] |
toArray()
Creates
boolean array from buffered content. |
boolean[] |
toArray(int start,
int len)
Creates
boolean subarray from buffered content. |
public FastBooleanBuffer()
boolean buffer. The buffer capacity is
initially 1024 bytes, though its size increases if necessary.public FastBooleanBuffer(int size)
boolean buffer, with a buffer capacity of
the specified size, in bytes.size - the initial size.java.lang.IllegalArgumentException - if size is negative.public FastBooleanBuffer append(boolean[] array, int off, int len)
boolean array to buffer.public FastBooleanBuffer append(boolean[] array)
boolean array to buffer.public FastBooleanBuffer append(boolean element)
boolean to buffer.public FastBooleanBuffer append(FastBooleanBuffer buff)
public int size()
public boolean isEmpty()
public int index()
boolean array chunk.
Represents the index of last used inner array chunk.public int offset()
public boolean[] array(int index)
boolean inner array chunk at given index.
May be used for iterating inner chunks in fast manner.public void clear()
public boolean[] toArray()
boolean array from buffered content.public boolean[] toArray(int start,
int len)
boolean subarray from buffered content.public boolean get(int index)
boolean element at given index.Copyright © 2003-2013 Jodd Team