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