public interface RawDoubleReader extends RawMemory
Objects of this type are created with the method
RawMemoryFactory.createRawDoubleReader(javax.realtime.device.RawMemoryRegion, long, int, int)
and
RawMemoryFactory.createRawDouble(javax.realtime.device.RawMemoryRegion, long, int, int)
. Each object references
a range of elements in the RawMemoryRegion
starting at the
base address provided to the factory method. The size provided
to the factory method determines the number of accessible elements.
Caching of the memory access is controlled by the factory that created this object. If the memory is not cached, this method guarantees serialized access. In other words, the memory access at the memory occurs in the same order as in the program. Multiple writes to the same location may not be coalesced.
Modifier and Type | Method and Description |
---|---|
int |
get(int offset,
double[] values)
Fills
values with elements from this instance,
where the nth element is at the address
base address + (offset + n)
× stride × element size in bytes. |
int |
get(int offset,
double[] values,
int start,
int count)
Fills
values from index start with
elements from this instance, where the nth element is at
the address base address + (offset + n) ×
stride × element size in bytes. |
double |
getDouble()
Gets the value at the first position referenced by this
instance, i.e., the value at its start address.
|
double |
getDouble(int offset)
Gets the value at the address represented by
offset from the
base of this instance: base address +
(offset × stride ×
element size in bytes). |
getAddress, getSize, getStride
double getDouble()
double getDouble(int offset) throws OffsetOutOfBoundsException
offset
from the
base of this instance: base address +
(offset
× stride
×
element size in bytes).
When an exception is thrown, no data is transferred.OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in
the raw memory region.offset
- of double in the memory region starting from the address
specified in the associated factory method.int get(int offset, double[] values) throws OffsetOutOfBoundsException, NullPointerException
values
with elements from this instance,
where the nth element is at the address
base address + (offset + n)
× stride
× element size in bytes.
Only the doubles in the intersection of the start and end of
values
and the base address and the
end of the memory region are transferred. When an exception is
thrown, no data is transferred.OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory region.NullPointerException
- when values
is null.offset
- of the first double in the memory region to transfer.values
- The array to receive the doublesvalues
.int get(int offset, double[] values, int start, int count) throws OffsetOutOfBoundsException, ArrayIndexOutOfBoundsException, NullPointerException
values
from index start
with
elements from this instance, where the nth element is at
the address base address + (offset + n)
×
stride
× element size in bytes. The
number of bytes transferred is the minimum of count
,
the size of the memory region minus offset
, and
length of values
minus start
. When an
exception is thrown, no data is transferred.OffsetOutOfBoundsException
- when offset
is
negative or either offset
or offset
+
count
is greater than or equal to the size of this
raw memory area.ArrayIndexOutOfBoundsException
- when start
is
negative or either start
or start
+
count
is greater than or equal to the size of values.NullPointerException
- when values
is null or
count
is negative.offset
- of the first double in the memory region to transfer.values
- The array to receive the doubles.start
- The first index in array to fill.count
- The maximum number of doubles to copy.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.