|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.RawMemoryAccess | +--javax.realtime.RawMemoryFloatAccess
This class holds 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.
Field Summary | |
private long |
base
|
private java.lang.Runnable |
logic
|
private long |
size
|
Constructor Summary | |
protected |
RawMemoryFloatAccess(long base,
long size)
|
|
RawMemoryFloatAccess(java.lang.Object type,
long size)
Create a RawMemoryFloatAccess object using the given parameters. |
|
RawMemoryFloatAccess(java.lang.Object type,
long base,
long size)
Create a RawMemoryFloatAccess object using the given parameters. |
protected |
RawMemoryFloatAccess(javax.realtime.RawMemoryAccess memory,
long base,
long size)
Constructor reserved for use by the memory object factory. |
Method Summary | |
static javax.realtime.RawMemoryFloatAccess |
createFloatAccess(java.lang.Object type,
long size)
type - An object representing the type of the memory required (dma, shared) - used to define the base address and control the mapping. |
static javax.realtime.RawMemoryFloatAccess |
createFloatAccess(java.lang.Object type,
long base,
long size)
type - An object representing the type of the memory required (dma, shared) - used to define the base address and control the mapping. |
double |
getDouble(long offset)
Gets the double at the given offset. |
void |
getDoubles(long offset,
double[] doubles,
int low,
int number)
Gets 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)
Gets the float at the given offset. |
void |
getFloats(long offset,
float[] floats,
int low,
int number)
Gets number float values sstarting at the give
offset in this, and assign them into the byte
array starting at position low . |
void |
setDouble(long offset,
double value)
Sets the double at the given offset. |
void |
setDoubles(long offset,
double[] doubles,
int low,
int number)
Sets number double values starting at the given offset
in this from the double array starting at position low . |
void |
setFloat(long offset,
float value)
Sets 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 float array starting at position low . |
Methods inherited from class javax.realtime.RawMemoryAccess |
create, create, getByte, getBytes, getInt, getInts, getLong, getLongs, getMappedAddress, getShort, getShorts, map, map, map, setByte, setBytes, setInt, setInts, setLong, setLongs, setShort, setShorts, subregion, unmap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private long base
private long size
private java.lang.Runnable logic
Constructor Detail |
public RawMemoryFloatAccess(java.lang.Object type, long size) throws java.lang.SecurityException, OffsetOutOfBoundsException, SizeOutOfBoundsException, UnsupportedPhysicalMemoryException, MemoryTypeConflictException
RawMemoryFloatAccess
object using the given 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.
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.
MemoryTypeConflictException
- The specified base does not point to memory
that matches the request type, or if
type
specifies attributes with
a conflict.public RawMemoryFloatAccess(java.lang.Object type, long base, long size) throws java.lang.SecurityException, OffsetOutOfBoundsException, SizeOutOfBoundsException, UnsupportedPhysicalMemoryException, MemoryTypeConflictException
RawMemoryFloatAccess
object using the given parameters.
type
- An Object
representing the type of memory required
(e.g., dma, shared) - used to define the base address
and control the mapping.base
- The physical memory address of the area.size
- The size of the area in bytes.
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.
MemoryTypeConflictException
- The specified base does not point to memory
that matches the request type, or if
type
specifies attributes with
a conflict.protected RawMemoryFloatAccess(long base, long size)
protected RawMemoryFloatAccess(javax.realtime.RawMemoryAccess memory, long base, long size)
Method Detail |
public static javax.realtime.RawMemoryFloatAccess createFloatAccess(java.lang.Object type, long size) throws java.lang.SecurityException, OffsetOutOfBoundsException, SizeOutOfBoundsException, UnsupportedPhysicalMemoryException
java.lang.SecurityException
OffsetOutOfBoundsException
SizeOutOfBoundsException
UnsupportedPhysicalMemoryException
public static javax.realtime.RawMemoryFloatAccess createFloatAccess(java.lang.Object type, long base, long size) throws java.lang.SecurityException, OffsetOutOfBoundsException, SizeOutOfBoundsException, UnsupportedPhysicalMemoryException
java.lang.SecurityException
OffsetOutOfBoundsException
SizeOutOfBoundsException
UnsupportedPhysicalMemoryException
public double getDouble(long offset) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
offset
- The offset t which to write the value.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.public void getDoubles(long offset, double[] doubles, int low, int number) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
number
double values starting at the given
offset
in this, and assigns them into the
double
array starting at position low
.
offset
- The offset at which to start reading.doubles
- The array into which the read items are placed.low
- The offset which is the starting point in the given
array for the read items to be placed.number
- The number of items to read.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.public float getFloat(long offset) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
offset
- The offset at which to get the value.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range or memory.public void getFloats(long offset, float[] floats, int low, int number) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
number
float values sstarting at the give
offset
in this, and assign them into the byte
array starting at position low
.
offset
- The offset at which to start reading.floats
- The array into which the read items are placed.low
- The offset which is the starting point in the given array
for the read items to be placed.number
- The number of items to read.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.public void setDouble(long offset, double value) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
offset
- The offset at which to set the value.value
- The value which will be written.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.public void setDoubles(long offset, double[] doubles, int low, int number) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
number
double values starting at the given offset
in this from the double array starting at position low
.
offset
- The offset at which to start writing.doubles
- The array from which the items are obtained.low
- The offset which is the starting point in the given array
for the items to be obtained.number
- The number of items to write.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.public void setFloat(long offset, float value) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
offset
- The offset at which to write the value.value
- The value which will be written.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.public void setFloats(long offset, float[] floats, int low, int number) throws OffsetOutOfBoundsException, SizeOutOfBoundsException
number
float values starting at the given offset
in this from the float array starting at position low
.
offset
- The offset at which to start writing.floats
- The array from which the items are obtained.low
- The offset which is the starting poing in the given array
for the items to be obtained.number
- The number of items to write.
OffsetOutOfBoundsException
- The address is invalid.
SizeOutOfBoundsException
- The size is negative or extends
into an invalid range of memory.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |