com.sun.j3d.internal
Class DoubleBufferWrapper

java.lang.Object
  extended by com.sun.j3d.internal.BufferWrapper
      extended by com.sun.j3d.internal.DoubleBufferWrapper

public class DoubleBufferWrapper
extends BufferWrapper

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
 
Fields inherited from class com.sun.j3d.internal.BufferWrapper
TYPE_BYTE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_NULL, TYPE_UNKNOWN
 
Constructor Summary
DoubleBufferWrapper(java.nio.DoubleBuffer buffer)
          Constructor initializes buffer with a java.nio.DoubleBuffer object.
DoubleBufferWrapper(J3DBuffer b)
          Constructor initializes buffer with a javax.media.j3d.J3DBuffer object.
 
Method Summary
 double get()
          Reads the double at this buffer's current position, and then increments the position.
 DoubleBufferWrapper get(double[] dst)
          Bulk get method.
 DoubleBufferWrapper get(double[] dst, int offset, int length)
          Bulk get method.
 double get(int index)
          Reads the double at the given offset into the buffer.
 java.nio.Buffer getBuffer()
          Returns the java.nio.Buffer contained within this DoubleBufferWrapper.
 J3DBuffer getJ3DBuffer()
          Creates and returns a J3DBuffer object containing the buffer in this DoubleBufferWrapper object.
 boolean isDirect()
           
 DoubleBufferWrapper put(double[] src)
          Bulk put method.
 
Methods inherited from class com.sun.j3d.internal.BufferWrapper
capacity, getBufferAsObject, getBufferType, limit, position, position, rewind
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleBufferWrapper

public DoubleBufferWrapper(java.nio.DoubleBuffer buffer)
Constructor initializes buffer with a java.nio.DoubleBuffer object.


DoubleBufferWrapper

public DoubleBufferWrapper(J3DBuffer b)
Constructor initializes buffer with a javax.media.j3d.J3DBuffer object.

Method Detail

getBuffer

public java.nio.Buffer getBuffer()
Returns the java.nio.Buffer contained within this DoubleBufferWrapper.


isDirect

public boolean isDirect()
Returns:
A boolean indicating whether the java.nio.Buffer object contained within this DoubleBuffer is direct or indirect.

get

public double get()
Reads the double at this buffer's current position, and then increments the position.


get

public double get(int index)
Reads the double at the given offset into the buffer.


get

public DoubleBufferWrapper get(double[] dst)
Bulk get method. Transfers dst.length doubles from the buffer to the destination array and increments the buffer's position by dst.length.


get

public DoubleBufferWrapper get(double[] dst,
                               int offset,
                               int length)
Bulk get method. Transfers length doubles from the buffer starting at position offset into the destination array.


put

public DoubleBufferWrapper put(double[] src)
Bulk put method. Transfers src.length doubles into the buffer at the current position.


getJ3DBuffer

public J3DBuffer getJ3DBuffer()
Creates and returns a J3DBuffer object containing the buffer in this DoubleBufferWrapper object.