Build 1.0_r1(from source)

java.nio
Class DoubleArrayBuffer

java.lang.Object
  extended by java.nio.Buffer
      extended by java.nio.DoubleBuffer
          extended by java.nio.DoubleArrayBuffer
All Implemented Interfaces:
Comparable<DoubleBuffer>
Direct Known Subclasses:
ReadOnlyDoubleArrayBuffer, ReadWriteDoubleArrayBuffer

abstract class DoubleArrayBuffer
extends DoubleBuffer

DoubleArrayBuffer, ReadWriteDoubleArrayBuffer and ReadOnlyDoubleArrayBuffer compose the implementation of array based double buffers.

DoubleArrayBuffer 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  double[] backingArray
           
protected  int offset
           
 
Fields inherited from class java.nio.Buffer
_elementSizeShift, capacity, limit, mark, position, UNSET_MARK
 
Constructor Summary
DoubleArrayBuffer(double[] array)
           
DoubleArrayBuffer(int capacity)
           
DoubleArrayBuffer(int capacity, double[] backingArray, int offset)
           
 
Method Summary
 double get()
          Returns the double at the current position and increase the position by 1.
 DoubleBuffer get(double[] dest, int off, int len)
          Reads doubles from the current position into the specified double array, starting from the specified offset, and increase the position by the number of doubles read.
 double get(int index)
          Returns a double 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 doubles from/to bytes.
 
Methods inherited from class java.nio.DoubleBuffer
_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 double[] backingArray

offset

protected final int offset
Constructor Detail

DoubleArrayBuffer

DoubleArrayBuffer(double[] array)

DoubleArrayBuffer

DoubleArrayBuffer(int capacity)

DoubleArrayBuffer

DoubleArrayBuffer(int capacity,
                  double[] backingArray,
                  int offset)
Method Detail

get

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

Specified by:
get in class DoubleBuffer
Returns:
The double at the current position.

get

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

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

get

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

Overrides:
get in class DoubleBuffer
Parameters:
dest - The target double array
off - The offset of the double array, must be no less than zero and no greater than dest.length
len - The number of doubles 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: DoubleBuffer
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 double buffer is direct, if it is based on a byte buffer and the byte buffer is direct.

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

order

public final ByteOrder order()
Description copied from class: DoubleBuffer
Returns the byte order used by this buffer when converting doubles 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 DoubleBuffer
Returns:
The byte order used by this buffer when converting doubles from/to bytes.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature