|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.nio.Buffer
java.nio.DoubleBuffer
java.nio.DoubleArrayBuffer
java.nio.ReadWriteDoubleArrayBuffer
final class ReadWriteDoubleArrayBuffer
DoubleArrayBuffer, ReadWriteDoubleArrayBuffer and ReadOnlyDoubleArrayBuffer compose the implementation of array based double buffers.
ReadWriteDoubleArrayBuffer extends DoubleArrayBuffer with all the write methods.
This class is marked final for runtime performance.
| Field Summary |
|---|
| Fields inherited from class java.nio.DoubleArrayBuffer |
|---|
backingArray, offset |
| Fields inherited from class java.nio.Buffer |
|---|
_elementSizeShift, capacity, limit, mark, position, UNSET_MARK |
| Constructor Summary | |
|---|---|
ReadWriteDoubleArrayBuffer(double[] array)
|
|
ReadWriteDoubleArrayBuffer(int capacity)
|
|
ReadWriteDoubleArrayBuffer(int capacity,
double[] backingArray,
int arrayOffset)
|
|
| Method Summary | |
|---|---|
DoubleBuffer |
asReadOnlyBuffer()
Returns a readonly buffer that shares content with this buffer. |
DoubleBuffer |
compact()
Compacts this double buffer. |
(package private) static ReadWriteDoubleArrayBuffer |
copy(DoubleArrayBuffer other,
int markOfOther)
|
DoubleBuffer |
duplicate()
Returns a duplicated buffer that shares content with this buffer. |
boolean |
isReadOnly()
Returns whether this buffer is readonly or not. |
protected double[] |
protectedArray()
Child class implements this method to realize array(). |
protected int |
protectedArrayOffset()
Child class implements this method to realize arrayOffset(). |
protected boolean |
protectedHasArray()
Child class implements this method to realize hasArray(). |
DoubleBuffer |
put(double c)
Writes the given double to the current position and increase the position by 1. |
DoubleBuffer |
put(double[] src,
int off,
int len)
Writes doubles in the given double array, starting from
the specified offset, to the current position and increase the position
by the number of doubles written. |
DoubleBuffer |
put(int index,
double c)
Write a double to the specified index of this buffer and the position is not changed. |
DoubleBuffer |
slice()
Returns a sliced buffer that shares content with this buffer. |
| Methods inherited from class java.nio.DoubleArrayBuffer |
|---|
get, get, get, isDirect, order |
| Methods inherited from class java.nio.DoubleBuffer |
|---|
_array, _arrayOffset, allocate, array, arrayOffset, compareTo, equals, get, hasArray, hashCode, put, put, toString, wrap, wrap |
| Methods inherited from class java.nio.Buffer |
|---|
capacity, clear, flip, hasRemaining, limit, limit, mark, position, position, remaining, reset, rewind |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
ReadWriteDoubleArrayBuffer(double[] array)
ReadWriteDoubleArrayBuffer(int capacity)
ReadWriteDoubleArrayBuffer(int capacity,
double[] backingArray,
int arrayOffset)
| Method Detail |
|---|
static ReadWriteDoubleArrayBuffer copy(DoubleArrayBuffer other,
int markOfOther)
public DoubleBuffer asReadOnlyBuffer()
DoubleBufferThe returned buffer is guaranteed to be a new instance, even this buffer is readonly itself. The new buffer's position, limit, capacity and mark are the same as this buffer.
The new buffer shares content with this buffer, which means this buffer's change of content will be visible to the new buffer. The two buffer's position, limit and mark are independent.
asReadOnlyBuffer in class DoubleBufferpublic DoubleBuffer compact()
DoubleBuffer
The remaining doubles will be moved to the head of the
buffer, staring from position zero. Then the position is set to
remaining(); the limit is set to capacity; the mark is
cleared.
compact in class DoubleBufferpublic DoubleBuffer duplicate()
DoubleBufferThe duplicated buffer's position, limit, capacity and mark are the same as this buffer. The duplicated buffer's readonly property and byte order are same as this buffer too.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
duplicate in class DoubleBufferpublic boolean isReadOnly()
Buffer
isReadOnly in class Bufferprotected double[] protectedArray()
DoubleBufferarray().
protectedArray in class DoubleBufferarray()protected int protectedArrayOffset()
DoubleBufferarrayOffset().
protectedArrayOffset in class DoubleBufferarrayOffset()protected boolean protectedHasArray()
DoubleBufferhasArray().
protectedHasArray in class DoubleBufferhasArray()public DoubleBuffer put(double c)
DoubleBuffer
put in class DoubleBufferc - The double to write
public DoubleBuffer put(int index,
double c)
DoubleBuffer
put in class DoubleBufferindex - The index, must be no less than zero and less than the limitc - The double to write
public DoubleBuffer put(double[] src,
int off,
int len)
DoubleBufferdoubles in the given double array, starting from
the specified offset, to the current position and increase the position
by the number of doubles written.
put in class DoubleBuffersrc - The source double arrayoff - The offset of double array, must be no less than zero and no
greater than src.lengthlen - The number of doubles to write, must be no
less than zero and no greater than
src.length - off
public DoubleBuffer slice()
DoubleBuffer
The sliced buffer's capacity will be this buffer's
remaining(), and its zero position will correspond to
this buffer's current position. The new buffer's position will be
0, limit will be its capacity, and its mark is unset. The new buffer's
readonly property and byte order are same as this buffer.
The new buffer shares content with this buffer, which means either buffer's change of content will be visible to the other. The two buffer's position, limit and mark are independent.
slice in class DoubleBuffer
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||