public class SparseValuesWithUnsignedIndices
extends java.lang.Object
SparseValues class, which uses signed 32-bit integers for the indices, this class uses Long
to represent the indices, allowing for the full range of unsigned 32-bit integers (0 to 4,294,967,295).
The indicesWithUnsigned32Int list contains the indices, while the values list contains the corresponding values. The two lists are parallel, meaning that the value at index i in the values list corresponds to the index at index i in the indicesWithUnsigned32Int list.
This class provides a constructor that takes a SparseValues object and converts the signed 32-bit integer
indices to unsigned 32-bit integers, as well as methods to get and set the indices and values.
| Constructor and Description |
|---|
SparseValuesWithUnsignedIndices()
Constructs an empty
SparseValuesWithUnsignedIndices object with empty lists for indices and values. |
SparseValuesWithUnsignedIndices(java.util.List<java.lang.Long> indicesWithUnsigned32Int,
java.util.List<java.lang.Float> values)
Constructs a
SparseValuesWithUnsignedIndices object with the given lists of indices and values. |
SparseValuesWithUnsignedIndices(SparseValues sparseValues)
Constructs a
SparseValuesWithUnsignedIndices object from a SparseValues object, converting the
signed 32-bit integer indices to unsigned 32-bit integers. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.Long> |
getIndicesWithUnsigned32IntList()
Returns the list of indices, represented as unsigned 32-bit integers.
|
java.util.List<java.lang.Float> |
getValuesList()
Returns the list of values corresponding to the indices.
|
void |
setIndicesWithUnsigned32Int(java.util.List<java.lang.Long> indicesWithUnsigned32Int)
Sets the list of indices, represented as unsigned 32-bit integers.
|
void |
setValues(java.util.List<java.lang.Float> values)
Sets the list of values corresponding to the indices.
|
java.lang.String |
toString() |
public SparseValuesWithUnsignedIndices()
SparseValuesWithUnsignedIndices object with empty lists for indices and values.public SparseValuesWithUnsignedIndices(java.util.List<java.lang.Long> indicesWithUnsigned32Int,
java.util.List<java.lang.Float> values)
SparseValuesWithUnsignedIndices object with the given lists of indices and values.indicesWithUnsigned32Int - The list of indices, represented as unsigned 32-bit integersvalues - The list of values corresponding to the indicespublic SparseValuesWithUnsignedIndices(SparseValues sparseValues)
SparseValuesWithUnsignedIndices object from a SparseValues object, converting the
signed 32-bit integer indices to unsigned 32-bit integers.sparseValues - The SparseValues object to convertpublic java.util.List<java.lang.Long> getIndicesWithUnsigned32IntList()
public void setIndicesWithUnsigned32Int(java.util.List<java.lang.Long> indicesWithUnsigned32Int)
indicesWithUnsigned32Int - The new list of indicespublic java.util.List<java.lang.Float> getValuesList()
public void setValues(java.util.List<java.lang.Float> values)
values - The new list of valuespublic java.lang.String toString()
toString in class java.lang.Object