Package com.igormaznitsa.jbbp.model
Interface JBBPNumericField
- All Superinterfaces:
JBBPInvertableBitOrder,JBBPNamedField
- All Known Implementing Classes:
JBBPFieldBit,JBBPFieldBoolean,JBBPFieldByte,JBBPFieldDouble,JBBPFieldFloat,JBBPFieldInt,JBBPFieldLong,JBBPFieldShort,JBBPFieldUByte,JBBPFieldUInt,JBBPFieldUShort
The Interface describes a field which content can be represented as a numeric value.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the field value as boolean, usually if the value is 0 then false, true otherwise.doubleGet the field value as double.floatGet the field value as float.intgetAsInt()Get the field value as integer.longGet the field value as longMethods inherited from interface com.igormaznitsa.jbbp.model.JBBPInvertableBitOrder
getAsInvertedBitOrderMethods inherited from interface com.igormaznitsa.jbbp.model.JBBPNamedField
getNameInfo
-
Method Details
-
getAsInt
int getAsInt()Get the field value as integer.- Returns:
- the field value as integer
- Throws:
JBBPNumericFieldValueConversionException- can be thrown if impossible to represent saved value as int
-
getAsDouble
double getAsDouble()Get the field value as double.- Returns:
- the field value as double
- Throws:
JBBPNumericFieldValueConversionException- can be thrown if impossible to represent saved value as double- Since:
- 1.4.0
-
getAsFloat
float getAsFloat()Get the field value as float.- Returns:
- the field value as float
- Throws:
JBBPNumericFieldValueConversionException- can be thrown if impossible to represent saved value as float- Since:
- 1.4.0
-
getAsLong
long getAsLong()Get the field value as long- Returns:
- the field value as long
- Throws:
JBBPNumericFieldValueConversionException- can be thrown if impossible to represent saved value as long
-
getAsBool
boolean getAsBool()Get the field value as boolean, usually if the value is 0 then false, true otherwise.- Returns:
- the field value as boolean
- Throws:
JBBPNumericFieldValueConversionException- can be thrown if impossible to represent saved value as boolean
-