com.jogamp.common.nio
Class AbstractLongBuffer<B extends AbstractLongBuffer>

java.lang.Object
  extended by com.jogamp.common.nio.AbstractBuffer<B>
      extended by com.jogamp.common.nio.AbstractLongBuffer<B>
All Implemented Interfaces:
NativeBuffer<B>
Direct Known Subclasses:
Int64Buffer, PointerBuffer

public abstract class AbstractLongBuffer<B extends AbstractLongBuffer>
extends AbstractBuffer<B>

Hardware independent container for native pointer arrays. The native values (NIO direct ByteBuffer) might be 32bit or 64bit wide, depending of the CPU pointer width.

Author:
Michael Bien, Sven Gothel

Field Summary
protected  long[] backup
           
 
Fields inherited from class com.jogamp.common.nio.AbstractBuffer
bb, capacity, position
 
Constructor Summary
protected AbstractLongBuffer(ByteBuffer bb, int elementSize)
           
 
Method Summary
 long[] array()
           
 long get()
          Relative get method.
abstract  long get(int idx)
          Absolute get method.
 AbstractLongBuffer get(long[] dest, int offset, int length)
          Relative bulk get method.
 boolean hasArray()
           
 B put(B src)
          Relative bulk get method.
abstract  B put(int index, long value)
          Absolute put method.
 B put(long value)
          Relative put method.
 AbstractLongBuffer put(long[] src, int offset, int length)
          Relative bulk put method.
 
Methods inherited from class com.jogamp.common.nio.AbstractBuffer
arrayOffset, capacity, getBuffer, hasRemaining, isDirect, limit, position, position, remaining, rewind, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

backup

protected long[] backup
Constructor Detail

AbstractLongBuffer

protected AbstractLongBuffer(ByteBuffer bb,
                             int elementSize)
Method Detail

hasArray

public final boolean hasArray()
Specified by:
hasArray in interface NativeBuffer<B extends AbstractLongBuffer>
Overrides:
hasArray in class AbstractBuffer<B extends AbstractLongBuffer>

array

public final long[] array()

get

public abstract long get(int idx)
Absolute get method. Get the pointer value at the given index


get

public final long get()
Relative get method. Get the pointer value at the current position and increment the position by one.


get

public final AbstractLongBuffer get(long[] dest,
                                    int offset,
                                    int length)
Relative bulk get method. Copy the pointer values [ position .. position+length [ to the destination array [ dest[offset] .. dest[offset+length] [ and increment the position by length.


put

public abstract B put(int index,
                      long value)
Absolute put method. Put the pointer value at the given index


put

public final B put(long value)
Relative put method. Put the pointer value at the current position and increment the position by one.


put

public final AbstractLongBuffer put(long[] src,
                                    int offset,
                                    int length)
Relative bulk put method. Put the pointer values [ src[offset] .. src[offset+length] [ at the current position and increment the position by length.


put

public B put(B src)
Relative bulk get method. Copy the source values src[position .. capacity] [ to this buffer and increment the position by capacity-position.