Build 1.0_r1(from source)

java.nio
Class LongArrayBuffer

java.lang.Object
  extended by java.nio.Buffer
      extended by java.nio.LongBuffer
          extended by java.nio.LongArrayBuffer
All Implemented Interfaces:
Comparable<LongBuffer>
Direct Known Subclasses:
ReadOnlyLongArrayBuffer, ReadWriteLongArrayBuffer

abstract class LongArrayBuffer
extends LongBuffer

LongArrayBuffer, ReadWriteLongArrayBuffer and ReadOnlyLongArrayBuffer compose the implementation of array based long buffers.

LongArrayBuffer 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  long[] backingArray
           
protected  int offset
           
 
Fields inherited from class java.nio.Buffer
_elementSizeShift, capacity, limit, mark, position, UNSET_MARK
 
Constructor Summary
LongArrayBuffer(int capacity)
           
LongArrayBuffer(int capacity, long[] backingArray, int offset)
           
LongArrayBuffer(long[] array)
           
 
Method Summary
 long get()
          Returns the long at the current position and increase the position by 1.
 long get(int index)
          Returns a long at the specified index, and the position is not changed.
 LongBuffer get(long[] dest, int off, int len)
          Reads longs from the current position into the specified long array, starting from the specified offset, and increase the position by the number of longs read.
 boolean isDirect()
          Returns true if this buffer is direct.
 ByteOrder order()
          Returns the byte order used by this buffer when converting longs from/to bytes.
 
Methods inherited from class java.nio.LongBuffer
_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 long[] backingArray

offset

protected final int offset
Constructor Detail

LongArrayBuffer

LongArrayBuffer(long[] array)

LongArrayBuffer

LongArrayBuffer(int capacity)

LongArrayBuffer

LongArrayBuffer(int capacity,
                long[] backingArray,
                int offset)
Method Detail

get

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

Specified by:
get in class LongBuffer
Returns:
The long at the current position.

get

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

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

get

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

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

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

order

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

Build 1.0_r1(from source)

Please submit a feedback, bug or feature