S - scalar output typeA - array output typepublic abstract class HapiType<S,A> extends Object
| Modifier and Type | Field and Description |
|---|---|
static HapiType<Double,double[]> |
DOUBLE
Floating point type.
|
static HapiType<Integer,int[]> |
INTEGER
Integer type.
|
static HapiType<String,String[]> |
ISOTIME
Restricted ISO-8601 timestamp type.
|
static HapiType<String,String[]> |
STRING
String type.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
adjustInfo(DefaultValueInfo info)
Performs customisation appropriate to this type on a
metadata info object that will represent it.
|
abstract void |
applyFills(A array,
S fill)
Replaces array elements matching a given fill value
in place with a suitable blank value representation.
|
static HapiType<?,?> |
fromText(String txt)
Returns a type value given the identifier string as found
in the "type" member of a Parameter JSON object.
|
Class<A> |
getArrayClass()
Returns the output class for array values.
|
int |
getByteCount(int paramLength)
Returns the number of bytes required for a scalar element
with this type and the supplied length value.
|
String |
getIdentifier()
Returns the name for this type, which is also the
value of the "type" member in a corresponding Parameter JSON object.
|
Class<S> |
getScalarClass()
Returns the output class for scalar values.
|
abstract A |
readBinaryArray(byte[] buf,
int ipos,
int elSize,
int nel)
Returns an array value of this type from a binary buffer.
|
abstract S |
readBinaryScalar(byte[] buf,
int ipos,
int leng)
Returns a scalar value of this type from its binary representation.
|
abstract A |
readStringArray(String[] txts,
int ipos,
int nel)
Returns an array value of this type from an array of string
representations.
|
abstract S |
readStringScalar(String txt)
Returns a scalar value of this type from its text representation.
|
String |
toString() |
public String getIdentifier()
public Class<S> getScalarClass()
public Class<A> getArrayClass()
public int getByteCount(int paramLength)
paramLength is as supplied by
HapiParam.getLength().paramLength - string length, or -1 for non-string typespublic abstract S readStringScalar(String txt)
txt - text field as found in CSVpublic abstract S readBinaryScalar(byte[] buf, int ipos, int leng)
buf - bytes representing value as found in binary format streamipos - starting position of value in bufleng - length of value in bytespublic abstract A readStringArray(String[] txts, int ipos, int nel)
txts - text fields as found in CSV, elements may be nullipos - index of first element in txts to readnel - number of elements in txts to readpublic abstract A readBinaryArray(byte[] buf, int ipos, int elSize, int nel)
buf - bytes representing values as found in binary format streamipos - starting position of values in bufelSize - number of bytes per valuenel - number of values to decodenel elementspublic abstract void applyFills(A array, S fill)
array - array whose elements can be replacedfill - non-null value for which corresponding array
elements should be blankedpublic abstract void adjustInfo(DefaultValueInfo info)
info - metadata object to modify in placeCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.