Class Int32Value
- java.lang.Object
-
- com.smartgridready.communicator.common.api.values.Value
-
- com.smartgridready.communicator.common.api.values.NumberValue<java.lang.Integer>
-
- com.smartgridready.communicator.common.api.values.Int32Value
-
public class Int32Value extends NumberValue<java.lang.Integer>
Implements an SGr value containing a 32-bit signed integer value.
-
-
Field Summary
-
Fields inherited from class com.smartgridready.communicator.common.api.values.NumberValue
value
-
Fields inherited from class com.smartgridready.communicator.common.api.values.Value
UNSIGNED_LONG_MASK
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabsValue()Sets the instance's value to its absolute value, if possible.Int32Value[]asArray()Gets the value as array.static Int32Valueof(int value)Creates a new instance from int.voidroundToInt()Rounds the instance's value to the nearest integer, if possible.protected voidsetValue(double value)Updates the numeric value.-
Methods inherited from class com.smartgridready.communicator.common.api.values.NumberValue
equals, getBitmap, getBoolean, getDateTime, getEnum, getFloat32, getFloat64, getInt16, getInt16U, getInt32, getInt32U, getInt64, getInt64U, getInt8, getInt8U, getJson, getString, hashCode, scaleDown, scaleUp, toString
-
Methods inherited from class com.smartgridready.communicator.common.api.values.Value
enumToOrdinalValue, fromDiscreteInput, fromModbusRegister, fromString, getJson, toModbusDiscreteVal, toModbusRegister
-
-
-
-
Method Detail
-
setValue
protected void setValue(double value)
Description copied from class:NumberValueUpdates the numeric value.- Specified by:
setValuein classNumberValue<java.lang.Integer>- Parameters:
value- a double value
-
asArray
public Int32Value[] asArray()
Description copied from class:ValueGets the value as array.
-
absValue
public void absValue()
Description copied from class:ValueSets the instance's value to its absolute value, if possible.
-
roundToInt
public void roundToInt()
Description copied from class:ValueRounds the instance's value to the nearest integer, if possible.- Specified by:
roundToIntin classValue
-
of
public static Int32Value of(int value)
Creates a new instance from int.- Parameters:
value- the int value- Returns:
- an instance of
Int32Value
-
-