net.java.games.gluegen.runtime
Class StructAccessor

java.lang.Object
  extended bynet.java.games.gluegen.runtime.StructAccessor

public class StructAccessor
extends Object


Constructor Summary
StructAccessor(ByteBuffer bb)
           
 
Method Summary
 ByteBuffer getBuffer()
           
 byte getByteAt(int slot)
          Retrieves the byte at the specified slot (byte offset).
 char getCharAt(int slot)
          Retrieves the char at the specified slot (2-byte offset).
 double getDoubleAt(int slot)
          Retrieves the double at the specified slot (8-byte offset).
 float getFloatAt(int slot)
          Retrieves the float at the specified slot (4-byte offset).
 int getIntAt(int slot)
          Retrieves the int at the specified slot (4-byte offset).
 long getLongAt(int slot)
          Retrieves the long at the specified slot (8-byte offset).
 short getShortAt(int slot)
          Retrieves the short at the specified slot (2-byte offset).
 void setByteAt(int slot, byte v)
          Puts a byte at the specified slot (byte offset).
 void setCharAt(int slot, char v)
          Puts a char at the specified slot (2-byte offset).
 void setDoubleAt(int slot, double v)
          Puts a double at the specified slot (8-byte offset).
 void setFloatAt(int slot, float v)
          Puts a float at the specified slot (4-byte offset).
 void setIntAt(int slot, int v)
          Puts a int at the specified slot (4-byte offset).
 void setLongAt(int slot, long v)
          Puts a long at the specified slot (8-byte offset).
 void setShortAt(int slot, short v)
          Puts a short at the specified slot (2-byte offset).
 ByteBuffer slice(int byteOffset, int byteLength)
          Return a slice of the current ByteBuffer starting at the specified byte offset and extending the specified number of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructAccessor

public StructAccessor(ByteBuffer bb)
Method Detail

getBuffer

public ByteBuffer getBuffer()

slice

public ByteBuffer slice(int byteOffset,
                        int byteLength)
Return a slice of the current ByteBuffer starting at the specified byte offset and extending the specified number of bytes. Note that this method is not thread-safe with respect to the other methods in this class.


getByteAt

public byte getByteAt(int slot)
Retrieves the byte at the specified slot (byte offset).


setByteAt

public void setByteAt(int slot,
                      byte v)
Puts a byte at the specified slot (byte offset).


getCharAt

public char getCharAt(int slot)
Retrieves the char at the specified slot (2-byte offset).


setCharAt

public void setCharAt(int slot,
                      char v)
Puts a char at the specified slot (2-byte offset).


getDoubleAt

public double getDoubleAt(int slot)
Retrieves the double at the specified slot (8-byte offset).


setDoubleAt

public void setDoubleAt(int slot,
                        double v)
Puts a double at the specified slot (8-byte offset).


getFloatAt

public float getFloatAt(int slot)
Retrieves the float at the specified slot (4-byte offset).


setFloatAt

public void setFloatAt(int slot,
                       float v)
Puts a float at the specified slot (4-byte offset).


getIntAt

public int getIntAt(int slot)
Retrieves the int at the specified slot (4-byte offset).


setIntAt

public void setIntAt(int slot,
                     int v)
Puts a int at the specified slot (4-byte offset).


getLongAt

public long getLongAt(int slot)
Retrieves the long at the specified slot (8-byte offset).


setLongAt

public void setLongAt(int slot,
                      long v)
Puts a long at the specified slot (8-byte offset).


getShortAt

public short getShortAt(int slot)
Retrieves the short at the specified slot (2-byte offset).


setShortAt

public void setShortAt(int slot,
                       short v)
Puts a short at the specified slot (2-byte offset).