Package oracle.sql

## Interface VECTOR.SparseFloatArray

All Superinterfaces:
  `VECTOR.SparseArray`

Enclosing class:
  VECTOR

    public static interface VECTOR.SparseFloatArray
    extends VECTOR.SparseArray

A float-valued representation of SPARSE VECTOR data in Oracle Database. This interface is optimized for conversions of the FLOAT32 dimension type, but can also be used in conversions of the FLOAT64 and INT8 types.

Since:
  23.8

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods
`static VECTOR.SparseFloatArray` `fromDenseArray​(float[] denseArray)` Creates a SparseFloatArray that stores only the non-zero values of a float array.
`static VECTOR.SparseFloatArray` `of​(int length, int[] indices, float[] floatValues)` Creates a SparseFloatArray of the given length, indices, and values.
`float[]` `values()` Returns the non-zero values in the VECTOR data represented by this SparseFloatArray.

### Methods inherited from interface oracle.sql.VECTOR.SparseArray

`indices, length, toString`

### Method Detail

#### values

    float[] values()

Returns the non-zero values in the VECTOR data represented by this SparseFloatArray. 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 floats. Not null.

#### of

    static VECTOR.SparseFloatArray of​(int length,
                                      int[] indices,
                                      float[] floatValues)

Creates a SparseFloatArray of the given length, indices, and values. The SparseFloatArray retains a reference to the arrays of indices and values which are passed to this method. After this method returns, changing the values of these arrays will also change the values retained by the SparseFloatArray.

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 SparseFloatArray is set as a parameter in SQL executed by Oracle Database.

Parameters:
  `length` - Total length of the SparseFloatArray, including indices with the value of zero.
  `indices` - Indices of non-zero values, ordered from least to greatest, in the range of 0 (inclusive) and the given `length`(exclusive). Not null.
  `floatValues` - Non-zero values appearing at each of the given `indices`. Not null.
Returns:
  A SparseFloatArray of the given length, indices, and values. Not null.
Throws:
  `java.lang.NullPointerException` - If the indices or values are null.
  `java.lang.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

    static VECTOR.SparseFloatArray fromDenseArray​(float[] denseArray)

Creates a SparseFloatArray that stores only the non-zero values of a float array.

Parameters:
  `denseArray` - Array float values, including zeros. Not null.
Returns:
  A sparse array storing only the non-zero values of the dense array. Not null.
Throws:
  `java.lang.NullPointerException` - If the denseArray is null.