|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wimpi.modbus.util.Observable net.wimpi.modbus.procimg.ObservableRegister
Class implementing an observable register.
Field Summary | |
protected byte[] |
m_Register
The word (byte[2] holding the content of this register. |
Constructor Summary | |
ObservableRegister()
|
Method Summary | |
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). |
Methods inherited from class net.wimpi.modbus.util.Observable |
addObserver, getObserverCount, notifyObservers, removeObserver, removeObservers |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected byte[] m_Register
Constructor Detail |
public ObservableRegister()
Method Detail |
public int getValue()
InputRegister
getValue
in interface InputRegister
public final int toUnsignedShort()
InputRegister
toUnsignedShort
in interface InputRegister
public final void setValue(int v)
Register
setValue
in interface Register
v
- the value as unsigned short (int).public final short toShort()
InputRegister
toShort
in interface InputRegister
public final void setValue(short s)
Register
setValue
in interface Register
s
- the value as short.public final void setValue(byte[] bytes)
Register
setValue
in interface Register
bytes
- the raw data as byte[].public byte[] toBytes()
InputRegister
toBytes
in interface InputRegister
|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |