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

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

public abstract class AbstractBuffer<B extends AbstractBuffer>
extends Object
implements NativeBuffer<B>

Author:
Michael Bien, Sven Gothel

Field Summary
protected  ByteBuffer bb
           
protected  int capacity
           
protected  int position
           
 
Constructor Summary
protected AbstractBuffer(ByteBuffer bb, int elementSize)
           
 
Method Summary
 int arrayOffset()
           
 int capacity()
           
 ByteBuffer getBuffer()
           
 boolean hasArray()
           
 boolean hasRemaining()
           
 boolean isDirect()
           
 int limit()
           
 int position()
           
 B position(int newPos)
           
 int remaining()
           
 B rewind()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jogamp.common.nio.NativeBuffer
array, get, get, put, put, put
 

Field Detail

bb

protected final ByteBuffer bb

capacity

protected int capacity

position

protected int position
Constructor Detail

AbstractBuffer

protected AbstractBuffer(ByteBuffer bb,
                         int elementSize)
Method Detail

limit

public final int limit()
Specified by:
limit in interface NativeBuffer<B extends AbstractBuffer>

capacity

public final int capacity()
Specified by:
capacity in interface NativeBuffer<B extends AbstractBuffer>

position

public final int position()
Specified by:
position in interface NativeBuffer<B extends AbstractBuffer>

position

public final B position(int newPos)
Specified by:
position in interface NativeBuffer<B extends AbstractBuffer>

remaining

public final int remaining()
Specified by:
remaining in interface NativeBuffer<B extends AbstractBuffer>

hasRemaining

public final boolean hasRemaining()
Specified by:
hasRemaining in interface NativeBuffer<B extends AbstractBuffer>

rewind

public final B rewind()
Specified by:
rewind in interface NativeBuffer<B extends AbstractBuffer>

hasArray

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

arrayOffset

public int arrayOffset()
Specified by:
arrayOffset in interface NativeBuffer<B extends AbstractBuffer>

getBuffer

public final ByteBuffer getBuffer()
Specified by:
getBuffer in interface NativeBuffer<B extends AbstractBuffer>

isDirect

public final boolean isDirect()
Specified by:
isDirect in interface NativeBuffer<B extends AbstractBuffer>

toString

public String toString()
Overrides:
toString in class Object