public class DoubleComplexInterpreter extends BinaryFieldInterpreter<java.lang.Double[]>
Binary interpreter for the type "doubleComplex" of VOTable.
arraySeparator, arraySizeInterpreter, fixArraySizes, NB_BYTES, nbItems, strNullValue, TYPE_LABEL| Constructor | Description |
|---|---|
DoubleComplexInterpreter(int[] arraysizes) |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.util.ArrayList<java.lang.Double[]> |
convertIntoArray(java.lang.Object value) |
Converts the given value (single value or multidimensional array) into one array of one dimension.
|
protected java.lang.Double[] |
convertPrimary(java.lang.Object value) |
Converts/Casts the given object into an object of type T.
|
java.lang.Double[] |
decodePrimary(byte[] bytes,
int offset) |
Decodes only one data of type T from the given bytes array.
|
byte[] |
encodePrimary(java.lang.Double[] value) |
Encodes a single value of type T in binary.
|
protected java.lang.Class<java.lang.Double[][]> |
getArrayClass() |
Gets the precise array type.
|
arraySizeToString, convertToString, createEmptyArray, createInterpreter, decode, encode, getArraySize, getPadding, getPadding, readBytespublic DoubleComplexInterpreter(int[] arraysizes)
throws BinaryInterpreterException
BinaryInterpreterExceptionpublic java.lang.Double[] decodePrimary(byte[] bytes,
int offset)
throws BinaryInterpreterException
BinaryFieldInterpreterDecodes only one data of type T from the given bytes array.
WARNING: bytes is supposed to contain enough bytes (>= BinaryFieldInterpreter.NB_BYTES) from the given offset.
decodePrimary in class BinaryFieldInterpreter<java.lang.Double[]>bytes - Array to use to extract enough bytes so that decoding one data of type T.offset - Position from which bytes must be read.BinaryInterpreterException - If an error occurs while decoding bytes.protected java.lang.Class<java.lang.Double[][]> getArrayClass()
BinaryFieldInterpreterGets the precise array type.
Generally: T[].class, where T must be a concrete class.
getArrayClass in class BinaryFieldInterpreter<java.lang.Double[]>protected java.util.ArrayList<java.lang.Double[]> convertIntoArray(java.lang.Object value)
throws BinaryInterpreterException
BinaryFieldInterpreterConverts the given value (single value or multidimensional array) into one array of one dimension.
NOTE:
A String value will be considered as an array whose items are separated by BinaryFieldInterpreter.arraySeparator.
Another type (except an array) must be understandable by BinaryFieldInterpreter.convertPrimary(Object).
convertIntoArray in class BinaryFieldInterpreter<java.lang.Double[]>value - Value to convert (single value or multidimensional array).BinaryInterpreterException - If BinaryFieldInterpreter.convertPrimary(Object) fails.BinaryFieldInterpreter.convertPrimary(Object)protected java.lang.Double[] convertPrimary(java.lang.Object value)
throws BinaryInterpreterException
BinaryFieldInterpreterconvertPrimary in class BinaryFieldInterpreter<java.lang.Double[]>value - The value to cast. (MAY BE NULL)BinaryInterpreterException - If there is an error while converting the given value.public byte[] encodePrimary(java.lang.Double[] value)
throws BinaryInterpreterException
BinaryFieldInterpreterEncodes a single value of type T in binary.
NOTE: If the given value is null, BinaryFieldInterpreter.getPadding() will be returned.
encodePrimary in class BinaryFieldInterpreter<java.lang.Double[]>value - The value to encode. (MAY BE NULL).BinaryInterpreterException - If there is an error while encoding the given value.