javax.realtime
Class RawMemoryFloatAccess

java.lang.Object
  extended byjavax.realtime.RawMemoryAccess
      extended byjavax.realtime.RawMemoryFloatAccess

public class RawMemoryFloatAccess
extends RawMemoryAccess

This class extends the capabilities of RawMemoryAccess by additionally supporting the interpretation of raw memory as float and double types.

Since:
0.3.8
Author:
Morgan Deters

Constructor Summary
RawMemoryFloatAccess(Object type, long size)
          Constructs a raw memory accessor associated to a memory area of the given memory type and size.
RawMemoryFloatAccess(Object type, long base, long size)
          Constructs a raw memory accessor associated to a memory area of the given memory type and size, based at the given offset.
 
Method Summary
 double getDouble(long offset)
          Get the double at the given offset.
 void getDoubles(long offset, double[] doubles, int low, int number)
          Get a consecutive sequence of doubles at the given offset.
 float getFloat(long offset)
          Get the float at the given offset.
 void getFloats(long offset, float[] floats, int low, int number)
          Get a consecutive sequence of floats at the given offset.
 void setDouble(long offset, double value)
          Set the double at the given offset.
 void setDoubles(long offset, double[] doubles, int low, int number)
          Set a consecutive sequence of doubles at the given offset.
 void setFloat(long offset, float value)
          Set the float at the given offset.
 void setFloats(long offset, float[] floats, int low, int number)
          Set a consecutive sequence of floats at the given offset.
 
Methods inherited from class javax.realtime.RawMemoryAccess
getByte, getBytes, getInt, getInts, getLong, getLongs, getMappedAddress, getShort, getShorts, map, map, map, setByte, setBytes, setInt, setInts, setLong, setLongs, setShort, setShorts, unmap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawMemoryFloatAccess

public RawMemoryFloatAccess(Object type,
                            long size)
Constructs a raw memory accessor associated to a memory area of the given memory type and size.

Parameters:
type - the memory type
size - the size of the memory area
Throws:
SecurityException - the current execution context does not have permission to access physical memory, or memory of the given type
OffsetOutOfBoundsException - this exception is never thrown; it is in the signature to be spec-compliant
SizeOutOfBoundsException - the size is negative or too large
UnsupportedPhysicalMemoryException - the hardware does not support this type of memory
MemoryTypeConflictException - the type parameter's attributes conflict with each other

RawMemoryFloatAccess

public RawMemoryFloatAccess(Object type,
                            long base,
                            long size)
Constructs a raw memory accessor associated to a memory area of the given memory type and size, based at the given offset.

Parameters:
type - the memory type
base - the base offset of the memory area
size - the size of the memory area
Throws:
SecurityException - the current execution context does not have permission to access physical memory, or memory of the given type
OffsetOutOfBoundsException - this exception is never thrown; it is in the signature to be spec-compliant
SizeOutOfBoundsException - the size is negative or too large
UnsupportedPhysicalMemoryException - the hardware does not support this type of memory
MemoryTypeConflictException - the type parameter's attributes conflict with each other or with the specified base offset
Method Detail

getDouble

public double getDouble(long offset)
Get the double at the given offset.

Parameters:
offset - the memory offset to access
Returns:
the double at the given offset
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

getDoubles

public void getDoubles(long offset,
                       double[] doubles,
                       int low,
                       int number)
Get a consecutive sequence of doubles at the given offset.

Parameters:
offset - the memory offset to access
doubles - the array to copy doubles into
low - the offset into the array at which to start copying
number - the number of doubles to copy
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

getFloat

public float getFloat(long offset)
Get the float at the given offset.

Parameters:
offset - the memory offset to access
Returns:
the float at the given offset
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

getFloats

public void getFloats(long offset,
                      float[] floats,
                      int low,
                      int number)
Get a consecutive sequence of floats at the given offset.

Parameters:
offset - the memory offset to access
floats - the array to copy floats into
low - the offset into the array at which to start copying
number - the number of floats to copy
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

setDouble

public void setDouble(long offset,
                      double value)
Set the double at the given offset.

Parameters:
offset - the memory offset to access
value - the value to assign the double in memory
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

setDoubles

public void setDoubles(long offset,
                       double[] doubles,
                       int low,
                       int number)
Set a consecutive sequence of doubles at the given offset.

Parameters:
offset - the memory offset to access
doubles - the array to copy doubles from
low - the offset into the array at which to start copying
number - the number of doubles to copy
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

setFloat

public void setFloat(long offset,
                     float value)
Set the float at the given offset.

Parameters:
offset - the memory offset to access
value - the value to assign the float in memory
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area

setFloats

public void setFloats(long offset,
                      float[] floats,
                      int low,
                      int number)
Set a consecutive sequence of floats at the given offset.

Parameters:
offset - the memory offset to access
floats - the array to copy floats from
low - the offset into the array at which to start copying
number - the number of floats to copy
Throws:
OffsetOutOfBoundsException - the given offset is negative or outside the range of this raw memory area
SizeOutOfBoundsException - satisfying the request would require accessing storage beyond the end of the memory area


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2006 Angelo Corsaro and Morgan Deters.