Top Description Fields Constructors Methods
com.jogamp.common.nio

public Class PointerBuffer

extends AbstractBuffer<PointerBuffer>
Class Inheritance
Imports
java.nio.Buffer, .ByteBuffer, .IntBuffer, .LongBuffer, com.jogamp.common.os.Platform, com.jogamp.common.util.LongObjectHashMap

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.
Authors
Sven Gothel, Michael Bien

Field Summary

Modifier and TypeField and Description
protected LongObjectHashMap
public static final int
Inherited from com.jogamp.common.nio.AbstractBuffer:
buffercapacityelementSizeposition

Constructor Summary

AccessConstructor and Description
pack-priv
PointerBuffer(final IntBuffer b)

supports backup array

pack-priv
PointerBuffer(final LongBuffer b)

supports backup array

Method Summary

Modifier and TypeMethod and Description
public static PointerBuffer
allocate(final int size)

Returns a non direct PointerBuffer in native order, having a backup array

public static PointerBuffer
allocateDirect(final int size)

Returns a direct PointerBuffer in native order, w/o backup array

pack-priv static PointerBuffer
create(final ByteBuffer bb)

no backup array, use for direct usage only

public final PointerBuffer

Returns:

new PointerBuffer sharing the same buffer data of this instance (identity), but having an independent position.
duplicate
()

public final long
get()

Implements com.jogamp.common.nio.NativeBuffer.get.

Relative get method.
public final long
get(final int idx)

Implements com.jogamp.common.nio.NativeBuffer.get.

Absolute get method.
public final PointerBuffer
get(final long[] dest, int offset, int length)

Relative bulk get method.

private native long
public final Buffer
getReferencedBuffer(final int index)

public final Buffer
public final PointerBuffer
put(final PointerBuffer src)

Implements com.jogamp.common.nio.NativeBuffer.put.

Relative bulk get method.
public final PointerBuffer
put(final int idx, final long v)

Implements com.jogamp.common.nio.NativeBuffer.put.

Absolute put method.
public final PointerBuffer
put(final long value)

Implements com.jogamp.common.nio.NativeBuffer.put, com.jogamp.common.nio.NativeBuffer.put.

Relative put method.
public final PointerBuffer
put(final long[] src, int offset, int length)

Relative bulk put method.

public final PointerBuffer
referenceBuffer(final int index, final Buffer bb)

Put the address of the given direct Buffer at the given position of this pointer array.

public final PointerBuffer
referenceBuffer(final Buffer bb)

Put the address of the given direct Buffer at the end of this pointer array.

public String
toString()

Overrides com.jogamp.common.nio.AbstractBuffer.toString.

Returns a string representation of the object.
private final void
public static PointerBuffer
wrap(final ByteBuffer src)

Inherited from com.jogamp.common.nio.AbstractBuffer:
arrayarrayOffsetcapacityelementSizegetBufferhasArrayhasRemainingisDirectlimitpositionpositionremainingrewind

Field Detail

dataMapback to summary
protected LongObjectHashMap dataMap
ELEMENT_SIZEback to summary
public static final int ELEMENT_SIZE

Constructor Detail

PointerBufferback to summary
pack-priv PointerBuffer(final IntBuffer b)

supports backup array

PointerBufferback to summary
pack-priv PointerBuffer(final LongBuffer b)

supports backup array

Method Detail

allocateback to summary
public static PointerBuffer allocate(final int size)

Returns a non direct PointerBuffer in native order, having a backup array

allocateDirectback to summary
public static PointerBuffer allocateDirect(final int size)

Returns a direct PointerBuffer in native order, w/o backup array

createback to summary
pack-priv static PointerBuffer create(final ByteBuffer bb)

no backup array, use for direct usage only

duplicateback to summary
public final PointerBuffer duplicate()
Returns:PointerBuffer

new PointerBuffer sharing the same buffer data of this instance (identity), but having an independent position.

getback to summary
public final long get()

Implements com.jogamp.common.nio.NativeBuffer.get.

Relative get method. Get the pointer value at the current position and increment the position by one.

Annotations
@Override
getback to summary
public final long get(final int idx)

Implements com.jogamp.common.nio.NativeBuffer.get.

Absolute get method. Get the pointer value at the given index

Annotations
@Override
getback to summary
public final PointerBuffer get(final 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.

getDirectBufferAddressImplback to summary
private native long getDirectBufferAddressImpl(Object directBuffer)
getReferencedBufferback to summary
public final Buffer getReferencedBuffer(final int index)
getReferencedBufferback to summary
public final Buffer getReferencedBuffer()
putback to summary
public final PointerBuffer put(final PointerBuffer src)

Implements com.jogamp.common.nio.NativeBuffer.put.

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

Annotations
@Override
putback to summary
public final PointerBuffer put(final int idx, final long v)

Implements com.jogamp.common.nio.NativeBuffer.put.

Absolute put method. Put the pointer value at the given index

Annotations
@Override
putback to summary
public final PointerBuffer put(final long value)

Implements com.jogamp.common.nio.NativeBuffer.put, com.jogamp.common.nio.NativeBuffer.put.

Relative put method. Put the pointer value at the current position and increment the position by one.

Annotations
@Override
putback to summary
public final PointerBuffer put(final 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.

referenceBufferback to summary
public final PointerBuffer referenceBuffer(final int index, final Buffer bb)

Put the address of the given direct Buffer at the given position of this pointer array. Adding a reference of the given direct Buffer to this object.

Exceptions
IllegalArgumentException:
if bb is null or not a direct buffer
referenceBufferback to summary
public final PointerBuffer referenceBuffer(final Buffer bb)

Put the address of the given direct Buffer at the end of this pointer array. Adding a reference of the given direct Buffer to this object.

toStringback to summary
public String toString()

Overrides com.jogamp.common.nio.AbstractBuffer.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
validateDataMapback to summary
private final void validateDataMap()
wrapback to summary
public static PointerBuffer wrap(final ByteBuffer src)