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
FixedField10
provide 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 FixedField10
INSTANCE
static FixedField10
MAX_VALUE
Maximum long field valuestatic FixedField10
MIN_VALUE
Minimum long field valuestatic FixedField10
ZERO_VALUE
Zero 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 int
compareTo(Field o)
FixedField
copyField()
Create new instance of this field with the same value.boolean
equals(java.lang.Object obj)
byte[]
getBinaryData()
Get data as a byte array.java.lang.String
getValueAsString()
Get field value as a formatted stringint
hashCode()
FixedField
newField()
Create new instance of this field type.void
setBinaryData(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:
compareTo
in interfacejava.lang.Comparable<Field>
- Overrides:
compareTo
in classBinaryField
-
copyField
public FixedField copyField()
Description copied from class:Field
Create new instance of this field with the same value.- Specified by:
copyField
in classFixedField
- 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 classFixedField
- 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 classBinaryField
- 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 classBinaryField
- Parameters:
data
- field data
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBinaryField
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classBinaryField
-
getValueAsString
public java.lang.String getValueAsString()
Description copied from class:Field
Get field value as a formatted string- Overrides:
getValueAsString
in classBinaryField
- Returns:
- field value string
-
-