public interface RawDoubleWriter extends RawMemory
Objects of this type are created with the method
RawMemoryFactory.createRawDoubleWriter(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 elements accessible.
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 |
set(int offset,
double[] values)
Copies from
values to the memory region,
from index start to elements
where the nth element is at the address
base address + (offset + n) ×
stride × element size in bytes. |
int |
set(int offset,
double[] values,
int start,
int count)
Copies
values to the memory region, where
offset is first double in the memory region to write and
start is the first index in values from
which to read. |
void |
setDouble(double value)
Sets the value at the first position referenced by this
instance, i.e., the value at its start address.
|
void |
setDouble(int offset,
double value)
Sets the value of the nth element referenced by this
instance, where
n is offset and the
address is base address + offset
× size of Double. |
getAddress, getSize, getStride
void setDouble(double value)
value
- The new value for the element.void setDouble(int offset, double value) throws OffsetOutOfBoundsException
n
is offset
and the
address is base address + offset
× size of Double. This operation must be atomic with
respect to all other raw memory accesses to the address. 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.value
- The new value for the element.int set(int offset, double[] values) throws OffsetOutOfBoundsException, NullPointerException
values
to the memory region,
from index start
to elements
where the nth element is at the address
base address + (offset + n)
×
stride
× element size in bytes.
Only the doubles in the intersection of values
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 first double in the memory region to be set.values
- The source of the data to write.values
.int set(int offset, double[] values, int start, int count) throws OffsetOutOfBoundsException, ArrayIndexOutOfBoundsException, IllegalArgumentException, NullPointerException
values
to the memory region, where
offset
is first double in the memory region to write and
start
is the first index in values
from
which to read. 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.IllegalArgumentException
offset
- of the first double in the memory region to set.values
- The array from which to retrieve the doubles.start
- The first index in array to copy.count
- The maximum number of doubles to copy.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.