Class JBBPFieldUByte

java.lang.Object
com.igormaznitsa.jbbp.model.JBBPAbstractField
com.igormaznitsa.jbbp.model.JBBPFieldUByte
All Implemented Interfaces:
JBBPInvertableBitOrder, JBBPNamedField, JBBPNumericField, Serializable

public final class JBBPFieldUByte extends JBBPAbstractField implements JBBPNumericField
Describes an unsigned byte value field.
Since:
1.0
See Also:
  • Constructor Details

    • JBBPFieldUByte

      public JBBPFieldUByte(JBBPNamedFieldInfo name, byte value)
      The Constructor.
      Parameters:
      name - a field name info, it can be null
      value - the field value
  • Method Details

    • reverseBits

      public static long reverseBits(byte value)
      Get the reversed bit representation of the value.
      Parameters:
      value - the value to be reversed
      Returns:
      the reversed value
    • getAsDouble

      public double getAsDouble()
      Description copied from interface: JBBPNumericField
      Get the field value as double.
      Specified by:
      getAsDouble in interface JBBPNumericField
      Returns:
      the field value as double
    • getAsFloat

      public float getAsFloat()
      Description copied from interface: JBBPNumericField
      Get the field value as float.
      Specified by:
      getAsFloat in interface JBBPNumericField
      Returns:
      the field value as float
    • getAsInt

      public int getAsInt()
      Description copied from interface: JBBPNumericField
      Get the field value as integer.
      Specified by:
      getAsInt in interface JBBPNumericField
      Returns:
      the field value as integer
    • getAsLong

      public long getAsLong()
      Description copied from interface: JBBPNumericField
      Get the field value as long
      Specified by:
      getAsLong in interface JBBPNumericField
      Returns:
      the field value as long
    • getAsBool

      public boolean getAsBool()
      Description copied from interface: JBBPNumericField
      Get the field value as boolean, usually if the value is 0 then false, true otherwise.
      Specified by:
      getAsBool in interface JBBPNumericField
      Returns:
      the field value as boolean
    • getAsInvertedBitOrder

      public long getAsInvertedBitOrder()
      Description copied from interface: JBBPInvertableBitOrder
      Get the value in inverted bit order.
      Specified by:
      getAsInvertedBitOrder in interface JBBPInvertableBitOrder
      Returns:
      the value in inverted bit order
    • getTypeAsString

      public String getTypeAsString()
      Description copied from class: JBBPAbstractField
      Get the field type in string representation.
      Specified by:
      getTypeAsString in class JBBPAbstractField
      Returns:
      the string representation of field type, like 'int', 'long', 'bool [123]'