Interface VECTOR.SparseByteArray
- All Superinterfaces:
VECTOR.SparseArray
- Enclosing class:
- VECTOR
- Since:
- 23.7
-
Method Summary
Modifier and TypeMethodDescriptionstatic VECTOR.SparseByteArrayfromDenseArray(byte[] denseArray) Creates a SparseByteArray that stores only the non-zero values of a byte array.static VECTOR.SparseByteArrayof(int length, int[] indices, byte[] byteValues) Creates a SparseByteArray of the given length, indices, and values.byte[]values()Returns the non-zero values in the VECTOR data represented by this SparseByteArray.Methods inherited from interface oracle.sql.VECTOR.SparseArray
indices, length, toString
-
Method Details
-
values
byte[] values()Returns the non-zero values in the VECTOR data represented by this SparseByteArray. The values returned by this method appear at the indices returned by the
VECTOR.SparseArray.indices()method.The array returned by this method may be one that backs this SparseArray. Modifying the array's values can modify the set of non-zero values retained by this SparseArray.
- Returns:
- Non-zero values as an array of bytes. Not null.
-
of
Creates a SparseByteArray of the given length, indices, and values. The arrays passed to this method are retained by the SparseByteArray. Modifying the values of these arrays will modify the indices and values retained by the SparseByteArray.
This method will only perform lightweight validations on the input. It will not validate the order or range of values in the indices array. These more extensive validations will occur when the SparseByteArray is set as a parameter in SQL executed by Oracle Database.
- Parameters:
length- Total length of dimensions in the VECTOR, including zero-valued dimensions.indices- Indices of non-zero values, ordered from least to greatest, in the range of 0 (inclusive) and the givenlength(exclusive). Not null.byteValues- Non-zero values appearing at each of the givenindices. Not null.- Returns:
- A SparseDoubleArray of the given length, indices, and values. Not null.
- Throws:
NullPointerException- If the indices or values are null.IllegalArgumentException- If the length is less than 0, or the indices or values have a length greater than 65535, or the indices and values have a different length.
-
fromDenseArray
Creates a SparseByteArray that stores only the non-zero values of a byte array.- Parameters:
denseArray- Array byte values, including zeros. Not null.- Returns:
- A sparse array storing only the non-zero values of the dense array. Not null.
- Throws:
NullPointerException- If the denseArray is null.
-