Package io.deephaven.integrations.common
Class PrimitiveArrayConversionUtility
java.lang.Object
io.deephaven.integrations.common.PrimitiveArrayConversionUtility
General purpose helper methods for array conversion methods from specific object types to/from primitive types. This
is specifically intended to improve performance in integration with Python, where conversion of primitive type arrays
involves direct copy of a memory buffer, and is much more performant than element-by-element inspection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]translateArrayBooleanToByte(Boolean[] array) Translates a java.lang.Boolean array to a byte array.static Boolean[]translateArrayByteToBoolean(byte[] array) Translates a byte array to a Boolean array.static long[]translateArrayInstantToLong(Instant[] array) Translates an Instant array to a long array.static Instant[]translateArrayLongToInstant(long[] array) Translates a long array to an Instant array.static Instant[]translateArrayStringToInstant(String[] array) Translates a String array to an Instant array.
-
Constructor Details
-
PrimitiveArrayConversionUtility
public PrimitiveArrayConversionUtility()
-
-
Method Details
-
translateArrayBooleanToByte
Translates a java.lang.Boolean array to a byte array. The mapping will be performed according toBooleanUtils.booleanAsByte(Boolean). This is the (psuedo)inverse of `translateArrayByteToBoolean`.- Parameters:
array- - the Boolean array- Returns:
- the byte array
-
translateArrayByteToBoolean
Translates a byte array to a Boolean array. The mapping will be performed according toBooleanUtils.byteAsBoolean(byte). This is the (psuedo)inverse of `translateArrayBooleanToByte`.- Parameters:
array- - the byte array- Returns:
- the Boolean array
-
translateArrayInstantToLong
Translates an Instant array to a long array. The mapping will be performed according toDateTimeUtils.epochNanos(Instant). This is the (psuedo)inverse of `translateArrayLongToInstant`.- Parameters:
array- - the Instant array- Returns:
- the corresponding long array
-
translateArrayLongToInstant
Translates a long array to an Instant array. The mapping will be performed according toDateTimeUtils.epochNanosToInstant(long). This is the (psuedo)inverse of `translateArrayLongToInstant`.- Parameters:
array- - the long array- Returns:
- the corresponding Instant array
-
translateArrayStringToInstant
Translates a String array to an Instant array. The mapping will be performed according toDateTimeUtils.parseInstant(String).- Parameters:
array- - the string array- Returns:
- the corresponding Instant array
-