public class FloatType extends NumberType<Float>
Float
type.name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
FloatType() |
Modifier and Type | Method and Description |
---|---|
protected Float |
convertNumber(Number value) |
Float |
read(ByteReader reader)
Read a value from the given input.
|
void |
skip(ByteReader reader)
Read and discard a value from the given input.
|
Float |
validate(Object obj)
Verify the given object is a valid instance of this
FieldType 's Java type and cast it to that type. |
void |
write(ByteWriter writer,
Float value)
Write a value to the given output.
|
compare, convert, equals, fromParseableString, hashCode, toParseableString
fromString, genericizeForIndex, getDefaultValue, getDefaultValueObject, getEncodingSignature, getKeyRange, getName, getTypeToken, hasPrefix0x00, hasPrefix0xff, toString, toString, validateAndWrite
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public Float read(ByteReader reader)
FieldType
public void write(ByteWriter writer, Float value)
FieldType
public void skip(ByteReader reader)
FieldType
public Float validate(Object obj)
FieldType
FieldType
's Java type and cast it to that type.
Note that this method must throw IllegalArgumentException
, not ClassCastException
or NullPointerException
, if obj
does not have the correct type, or is an illegal null value.
This method is allowed to perform widening conversions of the object that lose no information, e.g.,
from Integer
to Long
.
The implementation in FieldType
simply casts the value using this instance's raw Java type.
Subclasses should override this method to implement any other restrictions, e.g., disallowing null values.
validate
in class PrimitiveType<Float>
obj
- object to validateobj
cast to this field's typeprotected Float convertNumber(Number value)
convertNumber
in class PrimitiveType<Float>
Copyright © 2022. All rights reserved.