Build 1.0_r1(from source)

java.nio
Class FloatArrayBuffer

java.lang.Object
  extended by java.nio.Buffer
      extended by java.nio.FloatBuffer
          extended by java.nio.FloatArrayBuffer
All Implemented Interfaces:
Comparable<FloatBuffer>
Direct Known Subclasses:
ReadOnlyFloatArrayBuffer, ReadWriteFloatArrayBuffer

abstract class FloatArrayBuffer
extends FloatBuffer

FloatArrayBuffer, ReadWriteFloatArrayBuffer and ReadOnlyFloatArrayBuffer compose the implementation of array based float buffers.

FloatArrayBuffer implements all the shared readonly methods and is extended by the other two classes.

All methods are marked final for runtime performance.


Field Summary
protected  float[] backingArray
           
protected  int offset
           
 
Fields inherited from class java.nio.Buffer
_elementSizeShift, capacity, limit, mark, position, UNSET_MARK
 
Constructor Summary
FloatArrayBuffer(float[] array)
           
FloatArrayBuffer(int capacity)
           
FloatArrayBuffer(int capacity, float[] backingArray, int offset)
           
 
Method Summary
 float get()
          Returns the float at the current position and increase the position by 1.
 FloatBuffer get(float[] dest, int off, int len)
          Reads floats from the current position into the specified float array, starting from the specified offset, and increase the position by the number of floats read.
 float get(int index)
          Returns a float at the specified index, and the position is not changed.
 boolean isDirect()
          Returns true if this buffer is direct.
 ByteOrder order()
          Returns the byte order used by this buffer when converting floats from/to bytes.
 
Methods inherited from class java.nio.FloatBuffer
_array, _arrayOffset, allocate, array, arrayOffset, asReadOnlyBuffer, compact, compareTo, duplicate, equals, get, hasArray, hashCode, protectedArray, protectedArrayOffset, protectedHasArray, put, put, put, put, put, slice, toString, wrap, wrap
 
Methods inherited from class java.nio.Buffer
capacity, clear, flip, hasRemaining, isReadOnly, limit, limit, mark, position, position, remaining, reset, rewind
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

backingArray

protected final float[] backingArray

offset

protected final int offset
Constructor Detail

FloatArrayBuffer

FloatArrayBuffer(float[] array)

FloatArrayBuffer

FloatArrayBuffer(int capacity)

FloatArrayBuffer

FloatArrayBuffer(int capacity,
                 float[] backingArray,
                 int offset)
Method Detail

get

public final float get()
Description copied from class: FloatBuffer
Returns the float at the current position and increase the position by 1.

Specified by:
get in class FloatBuffer
Returns:
The float at the current position.

get

public final float get(int index)
Description copied from class: FloatBuffer
Returns a float at the specified index, and the position is not changed.

Specified by:
get in class FloatBuffer
Parameters:
index - The index, must be no less than zero and less than limit
Returns:
A float at the specified index.

get

public final FloatBuffer get(float[] dest,
                             int off,
                             int len)
Description copied from class: FloatBuffer
Reads floats from the current position into the specified float array, starting from the specified offset, and increase the position by the number of floats read.

Overrides:
get in class FloatBuffer
Parameters:
dest - The target float array
off - The offset of the float array, must be no less than zero and no greater than dest.length
len - The number of floats to read, must be no less than zero and no greater than dest.length - off
Returns:
This buffer

isDirect

public final boolean isDirect()
Description copied from class: FloatBuffer
Returns true if this buffer is direct.

A direct buffer will try its best to take advantage of native memory APIs and it may not stay in java heap, thus not affected by GC.

A float buffer is direct, if it is based on a byte buffer and the byte buffer is direct.

Specified by:
isDirect in class FloatBuffer
Returns:
True if this buffer is direct.

order

public final ByteOrder order()
Description copied from class: FloatBuffer
Returns the byte order used by this buffer when converting floats from/to bytes.

If this buffer is not based on a byte buffer, then always return the platform's native byte order.

Specified by:
order in class FloatBuffer
Returns:
The byte order used by this buffer when converting floats from/to bytes.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature