public class ObservableRegister extends Observable implements Register
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
m_Register
The word (byte[2] holding the content of this register.
|
| Constructor and Description |
|---|
ObservableRegister() |
| Modifier and Type | Method and Description |
|---|---|
int |
getValue()
Returns the value of this InputRegister.
|
void |
setValue(byte[] bytes)
Sets the content of this register from the given
raw bytes.
|
void |
setValue(int v)
Sets the content of this Register from the given
unsigned 16-bit value (unsigned short).
|
void |
setValue(short s)
Sets the content of this register from the given
signed 16-bit value (short).
|
byte[] |
toBytes()
Returns the content of this Register
as bytes.
|
short |
toShort()
Returns the content of this Register as
signed 16-bit value (short).
|
int |
toUnsignedShort()
Returns the content of this Register as
unsigned 16-bit value (unsigned short).
|
addObserver, getObserverCount, notifyObservers, removeObserver, removeObserversprotected byte[] m_Register
public int getValue()
InputRegistergetValue in interface InputRegisterpublic final int toUnsignedShort()
InputRegistertoUnsignedShort in interface InputRegisterpublic final void setValue(int v)
Registerpublic final short toShort()
InputRegistertoShort in interface InputRegisterpublic final void setValue(short s)
Registerpublic final void setValue(byte[] bytes)
Registerpublic byte[] toBytes()
InputRegistertoBytes in interface InputRegisterCopyright © 2017. All rights reserved.