T
- the type of the value held by the register.public interface RawRegister<T extends java.lang.Number> extends RawMemory
RawRegister
interface provides methods for setting and getting the value of a register or memory area
holding a value of type byte
, short
, int
or long
. A RawRegister
instance can
be obtained from a MMIODevice
instance.
Developers should be aware when using this API of the potential performance and memory allocation penalty induced by
primitive auto-boxing. For intensive reading and writing of registers such as data input and data output registers,
the use of the RawBlock
returned by MMIODevice.getAsRawBlock()
should be preferred.Modifier and Type | Method and Description |
---|---|
void |
and(T value)
Sets the value at the memory area associated with this object to the result of performing a logical AND of the
value at the memory area with the argument value.
|
void |
clearBit(int index)
Clears (sets to
0 ) the designated bit value at the memory area associated with this object. |
void |
clearBits(T mask)
Clears (sets to
0 ) the specified bits at the memory area associated with this object. |
T |
get()
Gets the value at the memory area associated with this object.
|
java.lang.Class<T> |
getType()
Returns the type of the value this
RawRegister instance can hold. |
boolean |
isBitSet(int index)
Checks whether the designated bit value at the memory area associated with this object is set (equal to
1
) |
void |
or(T value)
Sets the value at the memory area associated with this object to the result of performing a logical OR of the
value at the memory area with the argument value.
|
void |
set(T value)
Sets the value at the memory area associated with this object.
|
void |
setBit(int index)
Sets (to
1 ) the designated bit value at the memory area associated with this object. |
void |
setBits(T mask)
Sets (to
1 ) the specified bits at the memory area associated with this object. |
void |
xor(T value)
Sets the value at the memory area associated with this object to the result of performing a logical XOR of the
value at the memory area with the argument value.
|
void and(T value) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
value
- the value to perform a logical AND with.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.void clearBit(int index) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
0
) the designated bit value at the memory area associated with this object.index
- the index of the bit.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.java.lang.IllegalArgumentException
- if index
is less than 0
or greater or equal to the size in bits of the value at the
memory area associated with this object.void clearBits(T mask) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
0
) the specified bits at the memory area associated with this object.mask
- the bit mask.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.T get() throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
java.io.IOException
- if the associated memory area is not readable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.java.lang.Class<T> getType()
RawRegister
instance can hold.RawRegister
instance's value type.boolean isBitSet(int index) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
1
)index
- the index of the bit.java.io.IOException
- if the associated memory area is not readable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.java.lang.IllegalArgumentException
- if index
is less than 0
or greater or equal to the size in bits of the value at the
memory area associated with this object.void or(T value) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
value
- the value to perform a logical OR with.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.void set(T value) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
value
- the value to set.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.void setBit(int index) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
1
) the designated bit value at the memory area associated with this object.index
- the index of the bit.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.java.lang.IllegalArgumentException
- if index
is less than 0
or greater or equal to the size in bits of the value at the
memory area associated with this object.void setBits(T mask) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
1
) the specified bits at the memory area associated with this object.mask
- the bit mask.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.void xor(T value) throws java.io.IOException, UnavailableDeviceException, ClosedDeviceException
value
- the value to perform a logical XOR with.java.io.IOException
- if the associated memory area is not writable.UnavailableDeviceException
- if this device is not currently available - such as it is locked by another application.ClosedDeviceException
- if the device has been closed.Copyright © 2012, 2014, Oracle and/or its affiliates. All rights reserved.
Legal Notices