Package io.deephaven.util
Interface ArrayType<T>
- Type Parameters:
T-
- All Known Subinterfaces:
PrimitiveArrayType<T>
- All Known Implementing Classes:
PrimitiveArrayType.Booleans,PrimitiveArrayType.Bytes,PrimitiveArrayType.Chars,PrimitiveArrayType.Doubles,PrimitiveArrayType.Floats,PrimitiveArrayType.Ints,PrimitiveArrayType.Longs,PrimitiveArrayType.Shorts
public interface ArrayType<T>
A utility interface that allows strongly typed access to an array.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidA strongly-typed equivalent toSystem.arraycopy(Object, int, Object, int, int).default TcopyOfRange(T src, int from, int to) A strongly-typed equivalent toArrays.copyOfRange(Object[], int, int).intA strongly-typed equivalent toArray.getLength(Object).default booleanisAssignableFrom(Class<?> clazz) default booleannewInstance(int len) A strongly-typed equivalent toArray.newInstance(Class, int).
-
Method Details
-
getArrayType
-
isAssignableFrom
-
isAssignableFromObject
-
getLength
A strongly-typed equivalent toArray.getLength(Object).- Parameters:
array- the array- Returns:
- the length of the array
-
newInstance
A strongly-typed equivalent toArray.newInstance(Class, int).- Parameters:
len- the length of the new array- Returns:
- the new array
-
arrayCopy
A strongly-typed equivalent toSystem.arraycopy(Object, int, Object, int, int).- Parameters:
src- the source array.srcPos- starting position in the source array.dest- the destination array.destPos- starting position in the destination data.length- the number of array elements to be copied.
-
copyOfRange
A strongly-typed equivalent toArrays.copyOfRange(Object[], int, int).- Parameters:
src- the array from which a range is to be copiedfrom- the initial index of the range to be copied, inclusiveto- the final index of the range to be copied, exclusive- Returns:
- a new array containing the specified range from the original array
-