Package db
Class FixedField10
- java.lang.Object
-
- db.Field
-
- db.BinaryField
-
- db.FixedField
-
- db.FixedField10
-
- All Implemented Interfaces:
java.lang.Comparable<Field>
public class FixedField10 extends FixedField
FixedField10provide an unsigned 10-byte fixed-length field value. The most-significant byte corresponds to index-0 (i.e., data[0]).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class db.Field
Field.UnsupportedFieldException
-
-
Field Summary
Fields Modifier and Type Field Description static FixedField10INSTANCEstatic FixedField10MAX_VALUEMaximum long field valuestatic FixedField10MIN_VALUEMinimum long field valuestatic FixedField10ZERO_VALUEZero fixed10 field value-
Fields inherited from class db.BinaryField
data
-
Fields inherited from class db.Field
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description FixedField10()Construct a 10-byte fixed-length field with an initial value of 0.FixedField10(byte[] data)Construct a 10-byte fixed-length field with an initial value of data.FixedField10(byte[] data, boolean immutable)Construct a 10-byte fixed-length binary field with an initial value of data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Field o)FixedFieldcopyField()Create new instance of this field with the same value.booleanequals(java.lang.Object obj)byte[]getBinaryData()Get data as a byte array.java.lang.StringgetValueAsString()Get field value as a formatted stringinthashCode()FixedFieldnewField()Create new instance of this field type.voidsetBinaryData(byte[] data)Set data from binary byte array.-
Methods inherited from class db.FixedField
isVariableLength
-
Methods inherited from class db.BinaryField
getValueAsString, toString
-
Methods inherited from class db.Field
canIndex, getBooleanValue, getByteValue, getIntValue, getLongValue, getShortValue, getString, isSameType, setBooleanValue, setByteValue, setIntValue, setLongValue, setShortValue, setString
-
-
-
-
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
-
INSTANCE
public static final FixedField10 INSTANCE
-
-
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 valueimmutable- 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:
compareToin interfacejava.lang.Comparable<Field>- Overrides:
compareToin classBinaryField
-
copyField
public FixedField copyField()
Description copied from class:FieldCreate new instance of this field with the same value.- Specified by:
copyFieldin classFixedField- Returns:
- new field instance with same value
-
newField
public FixedField newField()
Description copied from class:FieldCreate new instance of this field type.- Specified by:
newFieldin classFixedField- Returns:
- new field instance with undefined initial value
-
getBinaryData
public byte[] getBinaryData()
Description copied from class:FieldGet data as a byte array.- Overrides:
getBinaryDatain classBinaryField- Returns:
- byte[]
-
setBinaryData
public void setBinaryData(byte[] data)
Description copied from class:FieldSet data from binary byte array. All variable-length fields must implement this method.- Overrides:
setBinaryDatain classBinaryField- Parameters:
data- field data
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBinaryField
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classBinaryField
-
getValueAsString
public java.lang.String getValueAsString()
Description copied from class:FieldGet field value as a formatted string- Overrides:
getValueAsStringin classBinaryField- Returns:
- field value string
-
-