public class PrimitiveValue extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PrimitiveValue.Representation
Representation type used for the stored value.
|
Modifier and Type | Field and Description |
---|---|
static BigInteger |
BI_MAX_VALUE_UINT64
Maximum value representation for an unsigned 64-bit type.
|
static BigInteger |
BI_NULL_VALUE_UINT64
Null value representation for an unsigned 64-bit type.
|
static long |
MAX_VALUE_CHAR
Maximum value representation for a char type.
|
static double |
MAX_VALUE_DOUBLE
Maximum value representation for a double precision 64-bit floating point type.
|
static float |
MAX_VALUE_FLOAT
Maximum value representation for a single precision 32-bit floating point type.
|
static long |
MAX_VALUE_INT16
Maximum value representation for a signed 16-bit type.
|
static long |
MAX_VALUE_INT32
Maximum value representation for a signed 32-bit type.
|
static long |
MAX_VALUE_INT64
Maximum value representation for a signed 64-bit type.
|
static long |
MAX_VALUE_INT8
Maximum value representation for a signed 8-bit type.
|
static long |
MAX_VALUE_UINT16
Maximum value representation for an unsigned 16-bit type.
|
static long |
MAX_VALUE_UINT32
Maximum value representation for an unsigned 32-bit type.
|
static long |
MAX_VALUE_UINT64
Maximum value representation for an unsigned 64-bit type.
|
static long |
MAX_VALUE_UINT8
Maximum value representation for an unsigned 8-bit type.
|
static long |
MIN_VALUE_CHAR
Minimum value representation for a char type.
|
static double |
MIN_VALUE_DOUBLE
Minimum value representation for a double precision 64-bit floating point type.
|
static float |
MIN_VALUE_FLOAT
Maximum value representation for a single precision 32-bit floating point type.
|
static long |
MIN_VALUE_INT16
Minimum value representation for a signed 16-bit type.
|
static long |
MIN_VALUE_INT32
Minimum value representation for a signed 32-bit type.
|
static long |
MIN_VALUE_INT64
Minimum value representation for a signed 64-bit type.
|
static long |
MIN_VALUE_INT8
Minimum value representation for a signed 8-bit type.
|
static long |
MIN_VALUE_UINT16
Minimum value representation for an unsigned 16-bit type.
|
static long |
MIN_VALUE_UINT32
Minimum value representation for an unsigned 32-bit type.
|
static long |
MIN_VALUE_UINT64
Minimum value representation for an unsigned 64-bit type.
|
static long |
MIN_VALUE_UINT8
Minimum value representation for an unsigned 8-bit type.
|
static long |
NULL_VALUE_CHAR
Null value representation for a char type.
|
static double |
NULL_VALUE_DOUBLE
Null value representation for a double precision 64-bit floating point type.
|
static float |
NULL_VALUE_FLOAT
Null value representation for a single precision 32-bit floating point type.
|
static long |
NULL_VALUE_INT16
Null value representation for a signed 16-bit type.
|
static long |
NULL_VALUE_INT32
Null value representation for a signed 32-bit type.
|
static long |
NULL_VALUE_INT64
Null value representation for a signed 64-bit type.
|
static long |
NULL_VALUE_INT8
Null value representation for a signed 8-bit type.
|
static long |
NULL_VALUE_UINT16
Null value representation for an unsigned 16-bit type.
|
static long |
NULL_VALUE_UINT32
Null value representation for an unsigned 32-bit type.
|
static long |
NULL_VALUE_UINT64
Null value representation for an unsigned 64-bit type.
|
static long |
NULL_VALUE_UINT8
Null value representation for an unsigned 8-bit type.
|
Constructor and Description |
---|
PrimitiveValue(byte[] value,
String characterEncoding,
int size)
Construct and fill in value as a byte array.
|
PrimitiveValue(byte value,
String characterEncoding)
Construct and fill in value as a long.
|
PrimitiveValue(double value,
int size)
Construct and fill in value as a double.
|
PrimitiveValue(long value,
int size)
Construct and fill in value as a long.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
byteArrayValue()
Return byte array value for this PrimitiveValue.
|
byte[] |
byteArrayValue(PrimitiveType type)
Return byte array value for this PrimitiveValue given a particular type
|
String |
characterEncoding()
The character encoding of the byte array representation.
|
double |
doubleValue()
Return double value for this PrimitiveValue.
|
boolean |
equals(Object value)
Determine if two values are equivalent.
|
int |
hashCode()
Return hashCode for value.
|
long |
longValue()
Return long value for this PrimitiveValue.
|
static PrimitiveValue |
parse(String value,
int length,
String characterEncoding)
Parse constant value string and set representation based on type, length, and characterEncoding
|
static PrimitiveValue |
parse(String value,
PrimitiveType primitiveType)
Parse constant value string and set representation based on type
|
static PrimitiveValue |
parse(String value,
PrimitiveType primitiveType,
String characterEncoding)
Parse constant value string and set representation based on type
|
PrimitiveValue.Representation |
representation()
Get the
PrimitiveValue.Representation of the value. |
int |
size()
Return encodedLength for this PrimitiveValue for serialization purposes.
|
String |
toString()
Return String value representation of this object.
|
public static final long MIN_VALUE_CHAR
public static final long MAX_VALUE_CHAR
public static final long NULL_VALUE_CHAR
public static final long MIN_VALUE_INT8
public static final long MAX_VALUE_INT8
public static final long NULL_VALUE_INT8
public static final long MIN_VALUE_UINT8
public static final long MAX_VALUE_UINT8
public static final long NULL_VALUE_UINT8
public static final long MIN_VALUE_INT16
public static final long MAX_VALUE_INT16
public static final long NULL_VALUE_INT16
public static final long MIN_VALUE_UINT16
public static final long MAX_VALUE_UINT16
public static final long NULL_VALUE_UINT16
public static final long MIN_VALUE_INT32
public static final long MAX_VALUE_INT32
public static final long NULL_VALUE_INT32
public static final long MIN_VALUE_UINT32
public static final long MAX_VALUE_UINT32
public static final long NULL_VALUE_UINT32
public static final long MIN_VALUE_INT64
public static final long MAX_VALUE_INT64
public static final long NULL_VALUE_INT64
public static final long MIN_VALUE_UINT64
public static final BigInteger BI_MAX_VALUE_UINT64
public static final long MAX_VALUE_UINT64
public static final BigInteger BI_NULL_VALUE_UINT64
public static final long NULL_VALUE_UINT64
public static final float MIN_VALUE_FLOAT
public static final float MAX_VALUE_FLOAT
public static final float NULL_VALUE_FLOAT
public static final double MIN_VALUE_DOUBLE
public static final double MAX_VALUE_DOUBLE
public static final double NULL_VALUE_DOUBLE
public PrimitiveValue(long value, int size)
value
- in long format.size
- of the type in bytes.public PrimitiveValue(byte value, String characterEncoding)
value
- in long formatcharacterEncoding
- of the char type.public PrimitiveValue(double value, int size)
value
- in double format.size
- of the type in bytes.public PrimitiveValue(byte[] value, String characterEncoding, int size)
value
- as a byte array.characterEncoding
- of the characters.size
- of string in characters.public PrimitiveValue.Representation representation()
PrimitiveValue.Representation
of the value.PrimitiveValue.Representation
of the value.public static PrimitiveValue parse(String value, PrimitiveType primitiveType)
value
- expressed as a String.primitiveType
- that this is supposed to be.PrimitiveValue
for the value.IllegalArgumentException
- if parsing malformed typepublic static PrimitiveValue parse(String value, PrimitiveType primitiveType, String characterEncoding)
value
- expressed as a String.primitiveType
- that this is supposed to be.characterEncoding
- of the constant value.PrimitiveValue
for the value.IllegalArgumentException
- if parsing malformed typepublic static PrimitiveValue parse(String value, int length, String characterEncoding)
value
- expressed as a String.length
- of the type.characterEncoding
- of the String.PrimitiveValue
for the value.IllegalArgumentException
- if parsing malformed type.public long longValue()
IllegalStateException
- if not a long value representation.public double doubleValue()
IllegalStateException
- if not a double value representation.public byte[] byteArrayValue()
IllegalStateException
- if not a byte array value representation.public byte[] byteArrayValue(PrimitiveType type)
type
- of this value.IllegalStateException
- if not a byte array value representation.public int size()
public String characterEncoding()
public String toString()
public boolean equals(Object value)
Copyright © 2013-2024 Real Logic Limited. All Rights Reserved.