com.sun.j3d.internal
Class BufferWrapper

java.lang.Object
  extended by com.sun.j3d.internal.BufferWrapper
Direct Known Subclasses:
ByteBufferWrapper, DoubleBufferWrapper, FloatBufferWrapper

public abstract class BufferWrapper
extends java.lang.Object

NIO Buffers are new in Java 1.4 but we need to run on 1.3 as well, so this class was created to hide the NIO classes from non-1.4 Java 3D users.

NOTE: We no longer need to support JDK 1.3 as of the Java 3D 1.3.2 community source release on java.net. We should be able to get rid of this class.


Field Summary
static int TYPE_BYTE
          Value returned from getBufferType(), this indicates that the BufferWrapper contains a java.nio.ByteBuffer.
static int TYPE_DOUBLE
          Value returned from getBufferType(), this indicates that the BufferWrapper contains a java.nio.DoubleBuffer.
static int TYPE_FLOAT
          Value returned from getBufferType(), this indicates that the BufferWrapper contains a java.nio.FloatBuffer.
static int TYPE_NULL
          Value returned from getBufferType(), this indicates that the BufferWrapper contains a null buffer.
static int TYPE_UNKNOWN
          Value returned from getBufferType(), this indicates that the BufferWrapper does not hold data of type byte, float, or double.
 
Constructor Summary
BufferWrapper()
          Never used - this class is abstract.
 
Method Summary
 int capacity()
           
 java.lang.Object getBufferAsObject()
           
static int getBufferType(javax.media.j3d.J3DBuffer b)
           
 int limit()
           
 int position()
           
 BufferWrapper position(int newPosition)
          Sets this buffer's position.
 BufferWrapper rewind()
          Resets this buffer's position to the previously marked position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NULL

public static final int TYPE_NULL
Value returned from getBufferType(), this indicates that the BufferWrapper contains a null buffer.

See Also:
Constant Field Values

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
Value returned from getBufferType(), this indicates that the BufferWrapper does not hold data of type byte, float, or double.

See Also:
Constant Field Values

TYPE_BYTE

public static final int TYPE_BYTE
Value returned from getBufferType(), this indicates that the BufferWrapper contains a java.nio.ByteBuffer.

See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
Value returned from getBufferType(), this indicates that the BufferWrapper contains a java.nio.FloatBuffer.

See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
Value returned from getBufferType(), this indicates that the BufferWrapper contains a java.nio.DoubleBuffer.

See Also:
Constant Field Values
Constructor Detail

BufferWrapper

public BufferWrapper()
Never used - this class is abstract.

Method Detail

getBufferAsObject

public java.lang.Object getBufferAsObject()
Returns:
Buffer as object of type Object.

capacity

public int capacity()
Returns:
This buffer's capacity (set at initialization in allocateDirect() ).
See Also:
ByteBufferWrapper.allocateDirect(int)

limit

public int limit()
Returns:
This buffer's limit.

position

public int position()
Returns:
This buffer's position.

position

public BufferWrapper position(int newPosition)
Sets this buffer's position.

Returns:
This buffer.

rewind

public BufferWrapper rewind()
Resets this buffer's position to the previously marked position.

Returns:
This buffer.

getBufferType

public static int getBufferType(javax.media.j3d.J3DBuffer b)
Returns:
An integer indicating the type of data held in this buffer.
See Also:
TYPE_NULL, TYPE_BYTE, TYPE_FLOAT, TYPE_DOUBLE, TYPE_UNKNOWN