javax.realtime
Class RawMemoryFloatAccess

java.lang.Object
  |
  +--javax.realtime.RawMemoryAccess
        |
        +--javax.realtime.RawMemoryFloatAccess

public class RawMemoryFloatAccess
extends RawMemoryAccess

This class holds the accessor methods for accessing a raw memory area by float and double types. Implementations are required to implement this class if and only if the underlying Java Virtual Machine supports floating point data types.

Many of the constructors and methods in this class throw OffsetOutOfBoundsException. This exception means that the value given in the offset parameter is either negative or outside the memory area.

Many of the constructors and methods in this class throw SizeOutOfBoundsException. This exception means that the value given in the size parameter is either negative, larger than an allowable range, or would cause an accessor method to access an address outside of the memory area.


Constructor Summary
RawMemoryFloatAccess(java.lang.Object type, long size)
          Create a RawMemoryFloatAccess object.
RawMemoryFloatAccess(java.lang.Object type, long base, long size)
          Create a RawMemoryFloatAccess object.
 
Method Summary
 double getDouble(long offset)
          Get the double at the given offset.
 void getDoubles(long offset, double[] doubles, int low, int number)
          Get number double values starting at the given offset in this, and assigns them into the double array starting at position low.
 float getFloat(long offset)
          Get the float at the given offset.
 void getFloats(long offset, float[] floats, int low, int number)
          Get number float values starting at the given offset in this and assign them into the byte array starting at position low.
 void setDouble(long offset, double value)
          Set the double at the given offset.
 void setDoubles(long offset, double[] doubles, int low, int number)
          Get number double values starting at the given offset in this, and assigns them into the double array starting at position low.
 void setFloat(long offset, float value)
          Set the float at the given offset.
 void setFloats(long offset, float[] floats, int low, int number)
          Set number float values starting at the given offset in this from the byte array starting at position low.
 
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(java.lang.Object type,
                            long size)
                     throws java.lang.SecurityException,
                            OffsetOutOfBoundsException,
                            SizeOutOfBoundsException,
                            UnsupportedPhysicalMemoryException,
                            MemoryTypeConflictException
Create a RawMemoryFloatAccess object.
Parameters:
type - An Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping
size - The size of the area in bytes.
Throws:
java.lang.SecurityException - The application doesn't have permissions to access physical memory or the given type of memory.
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type.

RawMemoryFloatAccess

public RawMemoryFloatAccess(java.lang.Object type,
                            long base,
                            long size)
                     throws java.lang.SecurityException,
                            OffsetOutOfBoundsException,
                            SizeOutOfBoundsException,
                            UnsupportedPhysicalMemoryException,
                            MemoryTypeConflictException
Create a RawMemoryFloatAccess object.
Parameters:
type - An Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping
size - The size of the area in bytes.
Throws:
java.lang.SecurityException - The application doesn't have permissions to access physical memory or the given type of memory.
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type.
Method Detail

getDouble

public double getDouble(long offset)
                 throws OffsetOutOfBoundsException,
                        SizeOutOfBoundsException
Get the double at the given offset.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

getDoubles

public void getDoubles(long offset,
                       double[] doubles,
                       int low,
                       int number)
                throws OffsetOutOfBoundsException,
                       SizeOutOfBoundsException
Get number double values starting at the given offset in this, and assigns them into the double array starting at position low.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

getFloat

public float getFloat(long offset)
               throws OffsetOutOfBoundsException,
                      SizeOutOfBoundsException
Get the float at the given offset.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

getFloats

public void getFloats(long offset,
                      float[] floats,
                      int low,
                      int number)
               throws OffsetOutOfBoundsException,
                      SizeOutOfBoundsException
Get number float values starting at the given offset in this and assign them into the byte array starting at position low.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

setFloat

public void setFloat(long offset,
                     float value)
              throws OffsetOutOfBoundsException,
                     SizeOutOfBoundsException
Set the float at the given offset.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

setFloats

public void setFloats(long offset,
                      float[] floats,
                      int low,
                      int number)
               throws OffsetOutOfBoundsException,
                      SizeOutOfBoundsException
Set number float values starting at the given offset in this from the byte array starting at position low.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

setDouble

public void setDouble(long offset,
                      double value)
               throws OffsetOutOfBoundsException,
                      SizeOutOfBoundsException
Set the double at the given offset.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.

setDoubles

public void setDoubles(long offset,
                       double[] doubles,
                       int low,
                       int number)
                throws OffsetOutOfBoundsException,
                       SizeOutOfBoundsException
Get number double values starting at the given offset in this, and assigns them into the double array starting at position low.
Throws:
OffsetOutOfBoundsException - The address is invalid.
SizeOutOfBoundsException - The size is negative or extends into an invalid range of memory.