com.kenai.jaffl.provider
Class ShareMemoryIO

java.lang.Object
  extended by com.kenai.jaffl.MemoryIO
      extended by com.kenai.jaffl.provider.AbstractMemoryIO
          extended by com.kenai.jaffl.provider.ShareMemoryIO
All Implemented Interfaces:
Pointer, DelegatingMemoryIO

public class ShareMemoryIO
extends AbstractMemoryIO
implements DelegatingMemoryIO


Field Summary
 
Fields inherited from interface com.kenai.jaffl.Pointer
SIZE
 
Constructor Summary
ShareMemoryIO(MemoryIO parent, long offset)
           
 
Method Summary
 long address()
          Gets the native address of this memory object (optional operation).
 void get(long offset, byte[] dst, int off, int len)
          Bulk byte get method.
 void get(long offset, double[] dst, int off, int len)
          Bulk double get method.
 void get(long offset, float[] dst, int off, int len)
          Bulk float get method.
 void get(long offset, int[] dst, int off, int len)
          Bulk int get method.
 void get(long offset, long[] dst, int off, int len)
          Bulk long get method.
 void get(long offset, short[] dst, int off, int len)
          Bulk short get method.
 byte getByte(long offset)
          Reads a 8 bit integer at the given offset.
 MemoryIO getDelegatedMemoryIO()
           
 double getDouble(long offset)
          Reads a 64 bit floating point value at the given offset.
 float getFloat(long offset)
          Reads a 32 bit floating point value at the given offset.
 int getInt(long offset)
          Reads a 32 bit integer at the given offset.
 long getLong(long offset)
          Reads a 64 bit integer at the given offset.
 MemoryIO getMemoryIO(long offset)
           
 MemoryIO getMemoryIO(long offset, long size)
           
 Pointer getPointer(long offset)
           
 short getShort(long offset)
          Reads a 16 bit integer at the given offset.
 java.lang.String getString(long offset)
           
 java.lang.String getString(long offset, int maxLength, java.nio.charset.Charset cs)
           
 int indexOf(long offset, byte value, int maxlen)
           
 boolean isDirect()
          Tells whether or not this memory object is direct.
 void put(long offset, byte[] dst, int off, int len)
          Bulk byte put method.
 void put(long offset, double[] dst, int off, int len)
          Bulk double put method.
 void put(long offset, float[] dst, int off, int len)
          Bulk float put method.
 void put(long offset, int[] dst, int off, int len)
          Bulk int put method.
 void put(long offset, long[] dst, int off, int len)
          Bulk long put method.
 void put(long offset, short[] dst, int off, int len)
          Bulk short put method.
 void putByte(long offset, byte value)
          Writes an 8 bit integer value at the given offset.
 void putDouble(long offset, double value)
          Writes a 64 bit floating point value at the given offset.
 void putFloat(long offset, float value)
          Writes a 32 bit floating point value at the given offset.
 void putInt(long offset, int value)
          Writes a 32 bit integer value at the given offset.
 void putLong(long offset, long value)
          Writes a 64 bit integer value at the given offset.
 void putPointer(long offset, Pointer value)
           
 void putShort(long offset, short value)
          Writes a 16 bit integer value at the given offset.
 void putString(long offset, java.lang.String string, int maxLength, java.nio.charset.Charset cs)
           
 void setMemory(long offset, long size, byte value)
           
 
Methods inherited from class com.kenai.jaffl.provider.AbstractMemoryIO
checkBounds, getAddress, getNativeLong, indexOf, putAddress, putAddress, putNativeLong, slice, slice, transferFrom, transferTo
 
Methods inherited from class com.kenai.jaffl.MemoryIO
allocate, allocateDirect, allocateDirect, wrap, wrap, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShareMemoryIO

public ShareMemoryIO(MemoryIO parent,
                     long offset)
Method Detail

isDirect

public final boolean isDirect()
Description copied from class: MemoryIO
Tells whether or not this memory object is direct. Memory objects can be either direct (representing native memory), or non-direct (representing java heap memory).

Specified by:
isDirect in interface Pointer
Specified by:
isDirect in class MemoryIO
Returns:
true if, and only if, this memory object is direct

address

public long address()
Description copied from class: MemoryIO
Gets the native address of this memory object (optional operation).

Specified by:
address in interface Pointer
Specified by:
address in class MemoryIO
Returns:
The native address of this memory object.

getDelegatedMemoryIO

public final MemoryIO getDelegatedMemoryIO()
Specified by:
getDelegatedMemoryIO in interface DelegatingMemoryIO

getByte

public byte getByte(long offset)
Description copied from class: MemoryIO
Reads a 8 bit integer at the given offset.

Specified by:
getByte in interface Pointer
Specified by:
getByte in class MemoryIO
Parameters:
offset - The offset from which the integer will be read.
Returns:
The byte value at the offset.

getShort

public short getShort(long offset)
Description copied from class: MemoryIO
Reads a 16 bit integer at the given offset.

Specified by:
getShort in interface Pointer
Specified by:
getShort in class MemoryIO
Parameters:
offset - The offset from which the integer will be read.
Returns:
The short value at the offset.

getInt

public int getInt(long offset)
Description copied from class: MemoryIO
Reads a 32 bit integer at the given offset.

Specified by:
getInt in interface Pointer
Specified by:
getInt in class MemoryIO
Parameters:
offset - The offset from which the integer will be read.
Returns:
The int value at the offset.

getLong

public long getLong(long offset)
Description copied from class: MemoryIO
Reads a 64 bit integer at the given offset.

Specified by:
getLong in interface Pointer
Specified by:
getLong in class MemoryIO
Parameters:
offset - The offset from which the integer will be read.
Returns:
The long value at the offset.

getFloat

public float getFloat(long offset)
Description copied from class: MemoryIO
Reads a 32 bit floating point value at the given offset.

Specified by:
getFloat in interface Pointer
Specified by:
getFloat in class MemoryIO
Parameters:
offset - The offset from which the integer will be read.
Returns:
The float value at the offset.

getDouble

public double getDouble(long offset)
Description copied from class: MemoryIO
Reads a 64 bit floating point value at the given offset.

Specified by:
getDouble in interface Pointer
Specified by:
getDouble in class MemoryIO
Parameters:
offset - The offset from which the integer will be read.
Returns:
The double value at the offset.

getMemoryIO

public MemoryIO getMemoryIO(long offset)
Specified by:
getMemoryIO in class MemoryIO

getMemoryIO

public MemoryIO getMemoryIO(long offset,
                            long size)
Specified by:
getMemoryIO in class MemoryIO

getPointer

public Pointer getPointer(long offset)
Specified by:
getPointer in interface Pointer
Specified by:
getPointer in class MemoryIO

getString

public java.lang.String getString(long offset)
Specified by:
getString in interface Pointer
Specified by:
getString in class MemoryIO

getString

public java.lang.String getString(long offset,
                                  int maxLength,
                                  java.nio.charset.Charset cs)
Specified by:
getString in interface Pointer
Specified by:
getString in class MemoryIO

putByte

public void putByte(long offset,
                    byte value)
Description copied from class: MemoryIO
Writes an 8 bit integer value at the given offset.

Specified by:
putByte in interface Pointer
Specified by:
putByte in class MemoryIO
Parameters:
offset - The offset at which the value will be written.
value - The value to be written.

putShort

public void putShort(long offset,
                     short value)
Description copied from class: MemoryIO
Writes a 16 bit integer value at the given offset.

Specified by:
putShort in interface Pointer
Specified by:
putShort in class MemoryIO
Parameters:
offset - The offset at which the value will be written.
value - The value to be written.

putInt

public void putInt(long offset,
                   int value)
Description copied from class: MemoryIO
Writes a 32 bit integer value at the given offset.

Specified by:
putInt in interface Pointer
Specified by:
putInt in class MemoryIO
Parameters:
offset - The offset at which the value will be written.
value - The value to be written.

putLong

public void putLong(long offset,
                    long value)
Description copied from class: MemoryIO
Writes a 64 bit integer value at the given offset.

Specified by:
putLong in interface Pointer
Specified by:
putLong in class MemoryIO
Parameters:
offset - The offset at which the value will be written.
value - The value to be written.

putFloat

public void putFloat(long offset,
                     float value)
Description copied from class: MemoryIO
Writes a 32 bit floating point value at the given offset.

Specified by:
putFloat in interface Pointer
Specified by:
putFloat in class MemoryIO
Parameters:
offset - The offset at which the value will be written.
value - The value to be written.

putDouble

public void putDouble(long offset,
                      double value)
Description copied from class: MemoryIO
Writes a 64 bit floating point value at the given offset.

Specified by:
putDouble in interface Pointer
Specified by:
putDouble in class MemoryIO
Parameters:
offset - The offset at which the value will be written.
value - The value to be written.

putPointer

public void putPointer(long offset,
                       Pointer value)
Specified by:
putPointer in interface Pointer
Specified by:
putPointer in class MemoryIO

putString

public void putString(long offset,
                      java.lang.String string,
                      int maxLength,
                      java.nio.charset.Charset cs)
Specified by:
putString in interface Pointer
Specified by:
putString in class MemoryIO

get

public void get(long offset,
                byte[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk byte get method. This method reads an array of bytes at the given offset into the given destination array.

Specified by:
get in interface Pointer
Specified by:
get in class MemoryIO
Parameters:
offset - The offset at which the values will be read.
dst - The array into which values are to be written.
off - The index within the destination array of the first value to be written.
len - The number of values to be written to the destination array.

put

public void put(long offset,
                byte[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk byte put method. This method writes an array of bytes at the given offset from the given source array.

Specified by:
put in interface Pointer
Specified by:
put in class MemoryIO
Parameters:
offset - The offset at which the values will be written.
dst - The source array from which values are to be read.
off - The index within the destination array of the first value to be read.
len - The number of values to be read from the source array.

get

public void get(long offset,
                short[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk short get method. This method reads an array of 16 bit integers at the given offset into the given destination array.

Specified by:
get in interface Pointer
Specified by:
get in class MemoryIO
Parameters:
offset - The offset at which the values will be read.
dst - The array into which values are to be written.
off - The index within the destination array of the first value to be written.
len - The number of values to be written to the destination array.

put

public void put(long offset,
                short[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk short put method. This method writes an array of 16 bit integers at the given offset from the given array.

Specified by:
put in interface Pointer
Specified by:
put in class MemoryIO
Parameters:
offset - The offset at which the values will be written.
dst - The source array from which values are to be read.
off - The index within the destination array of the first value to be read.
len - The number of values to be read from the source array.

get

public void get(long offset,
                int[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk int get method. This method reads an array of 32 bit integers at the given offset into the given destination array.

Specified by:
get in interface Pointer
Specified by:
get in class MemoryIO
Parameters:
offset - The offset at which the values will be read.
dst - The array into which values are to be written.
off - The index within the destination array of the first value to be written.
len - The number of values to be written to the destination array.

put

public void put(long offset,
                int[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk int put method. This method writes an array of 32 bit integers at the given offset from the given array.

Specified by:
put in interface Pointer
Specified by:
put in class MemoryIO
Parameters:
offset - The offset at which the values will be written.
dst - The source array from which values are to be read.
off - The index within the destination array of the first value to be read.
len - The number of values to be read from the source array.

get

public void get(long offset,
                long[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk long get method. This method reads an array of 64 bit integers at the given offset into the given destination array.

Specified by:
get in interface Pointer
Specified by:
get in class MemoryIO
Parameters:
offset - The offset at which the values will be read.
dst - The array into which values are to be written.
off - The index within the destination array of the first value to be written.
len - The number of values to be written to the destination array.

put

public void put(long offset,
                long[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk long put method. This method writes an array of 64 bit integers at the given offset from the given array.

Specified by:
put in interface Pointer
Specified by:
put in class MemoryIO
Parameters:
offset - The offset at which the values will be written.
dst - The source array from which values are to be read.
off - The index within the destination array of the first value to be read.
len - The number of values to be read from the source array.

get

public void get(long offset,
                float[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk float get method. This method reads an array of 32 bit floats at the given offset into the given destination array.

Specified by:
get in interface Pointer
Specified by:
get in class MemoryIO
Parameters:
offset - The offset at which the values will be read.
dst - The array into which values are to be written.
off - The index within the destination array of the first value to be written.
len - The number of values to be written to the destination array.

put

public void put(long offset,
                float[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk float put method. This method writes an array of 32 bit floats at the given offset from the given array.

Specified by:
put in interface Pointer
Specified by:
put in class MemoryIO
Parameters:
offset - The offset at which the values will be written.
dst - The source array from which values are to be read.
off - The index within the destination array of the first value to be read.
len - The number of values to be read from the source array.

get

public void get(long offset,
                double[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk double get method. This method reads an array of 64 bit floats at the given offset into the given destination array.

Specified by:
get in interface Pointer
Specified by:
get in class MemoryIO
Parameters:
offset - The offset at which the values will be read.
dst - The array into which values are to be written.
off - The index within the destination array of the first value to be written.
len - The number of values to be written to the destination array.

put

public void put(long offset,
                double[] dst,
                int off,
                int len)
Description copied from class: MemoryIO
Bulk double put method. This method writes an array of 64 bit floats at the given offset from the given array.

Specified by:
put in interface Pointer
Specified by:
put in class MemoryIO
Parameters:
offset - The offset at which the values will be written.
dst - The source array from which values are to be read.
off - The index within the destination array of the first value to be read.
len - The number of values to be read from the source array.

indexOf

public int indexOf(long offset,
                   byte value,
                   int maxlen)
Specified by:
indexOf in class MemoryIO

setMemory

public void setMemory(long offset,
                      long size,
                      byte value)
Specified by:
setMemory in class MemoryIO