Package uk.ac.starlink.ttools.filter
Class ArrayReader
java.lang.Object
uk.ac.starlink.ttools.filter.ArrayReader
Reads values from a typed numeric array.
- Since:
- 21 Jan 2022
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayReader
Returns an instance of this class suitable for a given array class.int
Returns array length for a suitable array object.double
Returns element numeric value for a suitable array object.
-
Method Details
-
getLength
Returns array length for a suitable array object.- Parameters:
array
- candidate array object- Returns:
- array length if array is of type expected by this reader, otherwise -1
-
getValue
Returns element numeric value for a suitable array object.- Parameters:
array
- candidate array object- Returns:
- numeric value of element
index
if array is of tye expected by this reader, otherwise Double.NaN
-
forClass
Returns an instance of this class suitable for a given array class.- Parameters:
arrayClazz
- class of arrays to read- Returns:
- array reader instance for array objects of the submitted type, or null if nothing suitable is available
-