Package deltix.qsrv.hf.pub.md
Class FloatDataType
- java.lang.Object
-
- deltix.qsrv.hf.pub.md.DataType
-
- deltix.qsrv.hf.pub.md.FloatDataType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public final class FloatDataType extends DataType
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FloatDataType.NumberAdapter
-
Nested classes/interfaces inherited from class deltix.qsrv.hf.pub.md.DataType
DataType.ConversionType
-
-
Field Summary
Fields Modifier and Type Field Description static double
DECIMAL_NULL
static java.lang.String[]
ENCODING
static java.lang.String
ENCODING_BINARY
static java.lang.String
ENCODING_DECIMAL64
static java.lang.String
ENCODING_FIXED_DOUBLE
static java.lang.String
ENCODING_FIXED_FLOAT
static java.lang.String
ENCODING_SCALE_AUTO
static int
FIXED_DOUBLE
Encode the number as a 64-bit double.static int
FIXED_FLOAT
Encode the number as a 32-bit float.static float
IEEE32_NULL
static double
IEEE64_NULL
java.lang.Number
max
java.lang.Number
min
static int[]
SCALE
static int
SCALE_AUTO
Encode the number as a scaled double, with automatically determined scale.static int
SCALE_DECIMAL64
-
Fields inherited from class deltix.qsrv.hf.pub.md.DataType
encoding, T_ARRAY_TYPE, T_BINARY_TYPE, T_BOOLEAN_TYPE, T_CHAR_TYPE, T_DATE_TIME_TYPE, T_DOUBLE_TYPE, T_ENUM_TYPE, T_FLOAT_TYPE, T_INTEGER_TYPE, T_OBJECT_TYPE, T_STRING_TYPE, T_TIME_OF_DAY_TYPE
-
-
Constructor Summary
Constructors Constructor Description FloatDataType(java.lang.String encoding, boolean nullable)
FloatDataType(java.lang.String encoding, boolean nullable, java.lang.Number min, java.lang.Number max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertValidImpl(java.lang.Object obj)
Checks a non-null Boxed value against constraints, if any.boolean
check(java.lang.Number min, java.lang.Number max)
static int
extractSize(java.lang.String encoding)
java.lang.String
getBaseName()
int
getCode()
static FloatDataType
getDefaultInstance()
static java.lang.String
getEncodingScaled(int size)
java.lang.Number
getMax()
java.lang.Number
getMaxNotNull()
java.lang.Number
getMin()
java.lang.Number
getMinNotNull()
java.lang.Number[]
getRange()
int
getScale()
DataType.ConversionType
isConvertible(DataType to)
boolean
isDecimal64()
boolean
isFloat()
void
parseEncoding(java.lang.String encoding)
static int
parseEncodingScaled(java.lang.String encoding)
protected void
readFields(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver)
static java.lang.String
staticFormat(double d)
static java.lang.String
staticFormat(float f)
static java.lang.String
staticFormat(long decimal)
static double
staticParseDouble(java.lang.CharSequence text)
Convert non-null CharSequence to doublestatic float
staticParseFloat(java.lang.CharSequence text)
Convert non-null CharSequence to floatprotected java.lang.Object
toBoxedImpl(java.lang.CharSequence text)
Parse non-null text and return an object without checking constraints.protected java.lang.String
toStringImpl(java.lang.Object obj)
Converts a non-null, constraint-compliant Boxed value to String.void
writeTo(java.io.DataOutputStream out)
-
Methods inherited from class deltix.qsrv.hf.pub.md.DataType
assertValid, clone, getEncoding, isNullable, isPrimitive, nullableInstance, outOfRange, parse, parseBoolean, parseByte, parseDate, parseDouble, parseFloat, parseInt, parseLong, parseShort, readFrom, setNullable, toString, unsupportedType
-
-
-
-
Field Detail
-
IEEE32_NULL
public static final float IEEE32_NULL
- See Also:
- Constant Field Values
-
IEEE64_NULL
public static final double IEEE64_NULL
- See Also:
- Constant Field Values
-
DECIMAL_NULL
public static final double DECIMAL_NULL
- See Also:
- Constant Field Values
-
FIXED_FLOAT
public static final int FIXED_FLOAT
Encode the number as a 32-bit float.- See Also:
- Constant Field Values
-
ENCODING_FIXED_FLOAT
public static final java.lang.String ENCODING_FIXED_FLOAT
- See Also:
- Constant Field Values
-
FIXED_DOUBLE
public static final int FIXED_DOUBLE
Encode the number as a 64-bit double.- See Also:
- Constant Field Values
-
ENCODING_FIXED_DOUBLE
public static final java.lang.String ENCODING_FIXED_DOUBLE
- See Also:
- Constant Field Values
-
SCALE_AUTO
public static final int SCALE_AUTO
Encode the number as a scaled double, with automatically determined scale.- See Also:
- Constant Field Values
-
ENCODING_SCALE_AUTO
public static final java.lang.String ENCODING_SCALE_AUTO
- See Also:
- Constant Field Values
-
SCALE_DECIMAL64
public static final int SCALE_DECIMAL64
- See Also:
- Constant Field Values
-
ENCODING_DECIMAL64
public static final java.lang.String ENCODING_DECIMAL64
- See Also:
- Constant Field Values
-
ENCODING_BINARY
public static final java.lang.String ENCODING_BINARY
- See Also:
- Constant Field Values
-
ENCODING
public static final java.lang.String[] ENCODING
-
SCALE
public static final int[] SCALE
-
min
public java.lang.Number min
-
max
public java.lang.Number max
-
-
Method Detail
-
extractSize
public static int extractSize(java.lang.String encoding) throws java.text.ParseException
- Throws:
java.text.ParseException
-
getDefaultInstance
public static FloatDataType getDefaultInstance()
-
getBaseName
public java.lang.String getBaseName()
- Specified by:
getBaseName
in classDataType
-
parseEncoding
public void parseEncoding(java.lang.String encoding)
- Overrides:
parseEncoding
in classDataType
-
getMin
public java.lang.Number getMin()
-
getMax
public java.lang.Number getMax()
-
getMinNotNull
public java.lang.Number getMinNotNull()
-
getMaxNotNull
public java.lang.Number getMaxNotNull()
-
check
public boolean check(java.lang.Number min, java.lang.Number max)
-
isFloat
public boolean isFloat()
-
isDecimal64
public boolean isDecimal64()
-
getScale
public int getScale()
-
getEncodingScaled
public static java.lang.String getEncodingScaled(int size)
-
parseEncodingScaled
public static int parseEncodingScaled(java.lang.String encoding)
-
assertValidImpl
protected void assertValidImpl(java.lang.Object obj)
Description copied from class:DataType
Checks a non-null Boxed value against constraints, if any. If the object is of unsupported type, this method should throwDataType.unsupportedType(java.lang.Object)
.- Specified by:
assertValidImpl
in classDataType
- Parameters:
obj
- A Boxed representation of a value.
-
staticParseFloat
public static float staticParseFloat(java.lang.CharSequence text)
Convert non-null CharSequence to float
-
staticParseDouble
public static double staticParseDouble(java.lang.CharSequence text)
Convert non-null CharSequence to double
-
staticFormat
public static java.lang.String staticFormat(float f)
-
staticFormat
public static java.lang.String staticFormat(double d)
-
staticFormat
public static java.lang.String staticFormat(long decimal)
-
toBoxedImpl
protected java.lang.Object toBoxedImpl(java.lang.CharSequence text)
Description copied from class:DataType
Parse non-null text and return an object without checking constraints.- Specified by:
toBoxedImpl
in classDataType
-
toStringImpl
protected java.lang.String toStringImpl(java.lang.Object obj)
Description copied from class:DataType
Converts a non-null, constraint-compliant Boxed value to String.- Specified by:
toStringImpl
in classDataType
- Parameters:
obj
- A non-null, valid value.- Returns:
- A String representation.
-
getRange
public java.lang.Number[] getRange()
-
isConvertible
public DataType.ConversionType isConvertible(DataType to)
- Specified by:
isConvertible
in classDataType
-
writeTo
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
-
readFields
protected void readFields(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver) throws java.io.IOException
- Overrides:
readFields
in classDataType
- Throws:
java.io.IOException
-
-