Package db

Class FixedField10

  • All Implemented Interfaces:
    java.lang.Comparable<Field>

    public class FixedField10
    extends FixedField
    FixedField10 provide an unsigned 10-byte fixed-length field value. The most-significant byte corresponds to index-0 (i.e., data[0]).
    • Field Detail

      • MIN_VALUE

        public static FixedField10 MIN_VALUE
        Minimum long field value
      • MAX_VALUE

        public static FixedField10 MAX_VALUE
        Maximum long field value
      • ZERO_VALUE

        public static final FixedField10 ZERO_VALUE
        Zero fixed10 field value
    • Constructor Detail

      • FixedField10

        public FixedField10()
        Construct a 10-byte fixed-length field with an initial value of 0.
      • FixedField10

        public FixedField10​(byte[] data)
        Construct a 10-byte fixed-length field with an initial value of data.
        Parameters:
        data - initial 10-byte binary value
        Throws:
        java.lang.IllegalArgumentException - thrown if data is not 10-bytes in length
      • FixedField10

        public FixedField10​(byte[] data,
                            boolean immutable)
        Construct a 10-byte fixed-length binary field with an initial value of data.
        Parameters:
        data - initial 10-byte binary value
        immutable - true if field value is immutable
        Throws:
        java.lang.IllegalArgumentException - thrown if data is not 10-bytes in length
    • Method Detail

      • compareTo

        public int compareTo​(Field o)
        Specified by:
        compareTo in interface java.lang.Comparable<Field>
        Overrides:
        compareTo in class BinaryField
      • copyField

        public FixedField copyField()
        Description copied from class: Field
        Create new instance of this field with the same value.
        Specified by:
        copyField in class FixedField
        Returns:
        new field instance with same value
      • newField

        public FixedField newField()
        Description copied from class: Field
        Create new instance of this field type.
        Specified by:
        newField in class FixedField
        Returns:
        new field instance with undefined initial value
      • getBinaryData

        public byte[] getBinaryData()
        Description copied from class: Field
        Get data as a byte array.
        Overrides:
        getBinaryData in class BinaryField
        Returns:
        byte[]
      • setBinaryData

        public void setBinaryData​(byte[] data)
        Description copied from class: Field
        Set data from binary byte array. All variable-length fields must implement this method.
        Overrides:
        setBinaryData in class BinaryField
        Parameters:
        data - field data
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class BinaryField
      • getValueAsString

        public java.lang.String getValueAsString()
        Description copied from class: Field
        Get field value as a formatted string
        Overrides:
        getValueAsString in class BinaryField
        Returns:
        field value string