public class DoubleArrayType extends Base64ArrayType<double[],Double>
double[]
array type. Does not support null arrays.
Array elements are encoded using DoubleType
, and the array is terminated by 0x0000000000000000L
,
which is an encoded value that can never be emitted by DoubleType
.
ARRAY_SUFFIX, MAX_DIMENSIONS
name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
DoubleArrayType() |
Modifier and Type | Method and Description |
---|---|
protected double[] |
createArray(List<Double> elements)
Create a new array instance containing the given elements.
|
protected double[] |
decode(DataInputStream input,
int numBytes) |
protected void |
encode(double[] array,
DataOutputStream output) |
protected Double |
getArrayElement(double[] array,
int index)
Get an element from the given array.
|
protected int |
getArrayLength(double[] array)
Get the length of the given array.
|
boolean |
hasPrefix0xff()
Determine whether any of this field type's encoded values start with a
0xff byte. |
double[] |
read(ByteReader reader)
Read a value from the given input.
|
void |
skip(ByteReader reader)
Read and discard a value from the given input.
|
void |
write(ByteWriter writer,
double[] array)
Write a value to the given output.
|
checkDecodeLength, fromParseableString, fromString, toParseableString, toParseableString, toString, toString
compare, convert, equals, getDimensions, hashCode
validate
genericizeForIndex, getDefaultValue, getDefaultValueObject, getEncodingSignature, getKeyRange, getName, getTypeToken, hasPrefix0x00, 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[] array)
FieldType
public void skip(ByteReader reader)
FieldType
public boolean hasPrefix0xff()
FieldType
0xff
byte.
Certain optimizations are possible when this is not the case. It is safe for this method to always return true.
Note: changing the return value of this method usually means changing the binary encoding, resulting in an incompatible type.
The implementation in FieldType
returns true
.
hasPrefix0xff
in class FieldType<double[]>
0xff
existsprotected int getArrayLength(double[] array)
ArrayType
getArrayLength
in class ArrayType<double[],Double>
array
- non-null arrayprotected Double getArrayElement(double[] array, int index)
ArrayType
getArrayElement
in class ArrayType<double[],Double>
array
- non-null arrayindex
- index of target element in array
index
protected double[] createArray(List<Double> elements)
ArrayType
createArray
in class ArrayType<double[],Double>
elements
- content for the new arrayprotected void encode(double[] array, DataOutputStream output) throws IOException
encode
in class Base64ArrayType<double[],Double>
IOException
protected double[] decode(DataInputStream input, int numBytes) throws IOException
decode
in class Base64ArrayType<double[],Double>
IOException
Copyright © 2022. All rights reserved.