|
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.FloatBuffer
java.nio.FloatArrayBuffer
java.nio.ReadOnlyFloatArrayBuffer
final class ReadOnlyFloatArrayBuffer
FloatArrayBuffer, ReadWriteFloatArrayBuffer and ReadOnlyFloatArrayBuffer compose the implementation of array based float buffers.
ReadOnlyFloatArrayBuffer extends FloatArrayBuffer with all the write methods throwing read only exception.
This class is marked final for runtime performance.
| Field Summary |
|---|
| Fields inherited from class java.nio.FloatArrayBuffer |
|---|
backingArray, offset |
| Fields inherited from class java.nio.Buffer |
|---|
_elementSizeShift, capacity, limit, mark, position, UNSET_MARK |
| Constructor Summary | |
|---|---|
ReadOnlyFloatArrayBuffer(int capacity,
float[] backingArray,
int arrayOffset)
|
|
| Method Summary | |
|---|---|
FloatBuffer |
asReadOnlyBuffer()
Returns a readonly buffer that shares content with this buffer. |
FloatBuffer |
compact()
Compacts this float buffer. |
(package private) static ReadOnlyFloatArrayBuffer |
copy(FloatArrayBuffer other,
int markOfOther)
|
FloatBuffer |
duplicate()
Returns a duplicated buffer that shares content with this buffer. |
boolean |
isReadOnly()
Returns whether this buffer is readonly or not. |
protected float[] |
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(). |
FloatBuffer |
put(float c)
Writes the given float to the current position and increase the position by 1. |
FloatBuffer |
put(float[] src,
int off,
int len)
Writes floats in the given float array, starting from the
specified offset, to the current position and increase the position by
the number of floats written. |
FloatBuffer |
put(FloatBuffer buf)
Writes all the remaining floats of the src
float buffer to this buffer's current position, and increase both
buffers' position by the number of floats copied. |
FloatBuffer |
put(int index,
float c)
Write a float to the specified index of this buffer and the position is not changed. |
FloatBuffer |
slice()
Returns a sliced buffer that shares content with this buffer. |
| Methods inherited from class java.nio.FloatArrayBuffer |
|---|
get, get, get, isDirect, order |
| Methods inherited from class java.nio.FloatBuffer |
|---|
_array, _arrayOffset, allocate, array, arrayOffset, compareTo, equals, get, hasArray, hashCode, 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 |
|---|
ReadOnlyFloatArrayBuffer(int capacity,
float[] backingArray,
int arrayOffset)
| Method Detail |
|---|
static ReadOnlyFloatArrayBuffer copy(FloatArrayBuffer other,
int markOfOther)
public FloatBuffer asReadOnlyBuffer()
FloatBufferThe 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 FloatBufferpublic FloatBuffer compact()
FloatBuffer
The remaining floats 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 FloatBufferpublic FloatBuffer duplicate()
FloatBufferThe 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 FloatBufferpublic boolean isReadOnly()
Buffer
isReadOnly in class Bufferprotected float[] protectedArray()
FloatBufferarray().
protectedArray in class FloatBufferarray()protected int protectedArrayOffset()
FloatBufferarrayOffset().
protectedArrayOffset in class FloatBufferarrayOffset()protected boolean protectedHasArray()
FloatBufferhasArray().
protectedHasArray in class FloatBufferhasArray()public FloatBuffer put(float c)
FloatBuffer
put in class FloatBufferc - The float to write
public FloatBuffer put(int index,
float c)
FloatBuffer
put in class FloatBufferindex - The index, must be no less than zero and less than the limitc - The float to write
public FloatBuffer put(FloatBuffer buf)
FloatBufferfloats of the src
float buffer to this buffer's current position, and increase both
buffers' position by the number of floats copied.
put in class FloatBufferbuf - The source float buffer
public final FloatBuffer put(float[] src,
int off,
int len)
FloatBufferfloats in the given float array, starting from the
specified offset, to the current position and increase the position by
the number of floats written.
put in class FloatBuffersrc - The source float arrayoff - The offset of float array, must be no less than zero and no
greater than src.lengthlen - The number of floats to write, must be no less
than zero and no greater than src.length - off
public FloatBuffer slice()
FloatBuffer
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 FloatBuffer
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||