public class DoubleType extends NumberType<Double>
Double
type.name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
DoubleType() |
Modifier and Type | Method and Description |
---|---|
protected Double |
convertNumber(Number value) |
Double |
read(ByteReader reader)
Read a value from the given input.
|
void |
skip(ByteReader reader)
Read and discard a value from the given input.
|
Double |
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,
Double 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 Double read(ByteReader reader)
FieldType
public void write(ByteWriter writer, Double value)
FieldType
public void skip(ByteReader reader)
FieldType
public Double 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<Double>
obj
- object to validateobj
cast to this field's typeprotected Double convertNumber(Number value)
convertNumber
in class PrimitiveType<Double>
Copyright © 2022. All rights reserved.