Top Fields Constructors Methods
com.jogamp.common.nio

public abstract Class AbstractBuffer<B extends AbstractBuffer>

extends Object
implements NativeBuffer<B extends AbstractBuffer>
Class Inheritance
All Implemented Interfaces
com.jogamp.common.nio.NativeBuffer
Known Direct Subclasses
com.jogamp.common.nio.PointerBuffer
Annotations
@SuppressWarnings:rawtypes
Imports
com.jogamp.common.os.*, java.nio.Buffer

Authors
Sven Gothel, Michael Bien

Field Summary

Modifier and TypeField and Description
protected final Buffer
protected final int
protected final int
protected int

Constructor Summary

AccessConstructor and Description
protected
AbstractBuffer(final Buffer
shall be in target format.
buffer
,
final int
the target element size in bytes.
elementSize
,
final int
the target capacity in elements of size elementSize.
capacity
)

capacity and elementSize should be match the equation w/ target buffer type

   capacity = elementSizeInBytes(buffer) * buffer.capacity() ) / elementSize

Method Summary

Modifier and TypeMethod and Description
public Object
public final int
public final int
public final int
public final Buffer
public final boolean
public final boolean
public final boolean
public final int
public final int
public final B
public final int
public final B
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
protected final Buffer buffer
capacityback to summary
protected final int capacity
elementSizeback to summary
protected final int elementSize
positionback to summary
protected int position

Constructor Detail

AbstractBufferback to summary
protected AbstractBuffer(final Buffer buffer, final int elementSize, final int capacity)

capacity and elementSize should be match the equation w/ target buffer type

   capacity = elementSizeInBytes(buffer) * buffer.capacity() ) / elementSize
Parameters
buffer:Buffer

shall be in target format.

elementSize:int

the target element size in bytes.

capacity:int

the target capacity in elements of size elementSize.

Method Detail

arrayback to summary
public Object array() throws UnsupportedOperationException

Implements com.jogamp.common.nio.NativeBuffer.array.

Returns:Object

Doc from com.jogamp.common.nio.NativeBuffer.array.

the primitive backup array of the buffer if hasArray() is true, otherwise it throws java.lang.UnsupportedOperationException. The returned primitive array maybe of type int[] or long[], etc ..

Annotations
@Override
Exceptions
UnsupportedOperationException:

Doc from com.jogamp.common.nio.NativeBuffer.array.

if this object has no backup array

arrayOffsetback to summary
public final int arrayOffset()

Implements com.jogamp.common.nio.NativeBuffer.arrayOffset.

Returns:int

Doc from com.jogamp.common.nio.NativeBuffer.arrayOffset.

the array offset of the optional primitive backup array of the buffer if hasArray() is true, otherwise 0.

Annotations
@Override
capacityback to summary
public final int capacity()

Implements com.jogamp.common.nio.NativeBuffer.capacity.

Annotations
@Override
elementSizeback to summary
public final int elementSize()

Implements com.jogamp.common.nio.NativeBuffer.elementSize.

Annotations
@Override
getBufferback to summary
public final Buffer getBuffer()

Implements com.jogamp.common.nio.NativeBuffer.getBuffer.

Annotations
@Override
hasArrayback to summary
public final boolean hasArray()

Implements com.jogamp.common.nio.NativeBuffer.hasArray.

Returns:boolean

Doc from com.jogamp.common.nio.NativeBuffer.hasArray.

true if this buffer has a primitive backup array, otherwise false

Annotations
@Override
hasRemainingback to summary
public final boolean hasRemaining()

Implements com.jogamp.common.nio.NativeBuffer.hasRemaining.

Annotations
@Override
isDirectback to summary
public final boolean isDirect()

Implements com.jogamp.common.nio.NativeBuffer.isDirect.

Annotations
@Override
limitback to summary
public final int limit()

Implements com.jogamp.common.nio.NativeBuffer.limit.

Annotations
@Override
positionback to summary
public final int position()

Implements com.jogamp.common.nio.NativeBuffer.position.

Annotations
@Override
positionback to summary
public final B position(final int newPos)

Implements com.jogamp.common.nio.NativeBuffer.position.

Annotations
@Override
remainingback to summary
public final int remaining()

Implements com.jogamp.common.nio.NativeBuffer.remaining.

Annotations
@Override
rewindback to summary
public final B rewind()

Implements com.jogamp.common.nio.NativeBuffer.rewind.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override