public class IntegerSparseArray extends ProtoSparseArray<IntegerSparseArray,int[],Integer,IntegerArray>
Array.IndexingOrder
Modifier and Type | Field and Description |
---|---|
protected static int[] |
empty
An empty array.
|
dimOffsets, dims, emptyIndices, state, strides
Modifier | Constructor and Description |
---|---|
|
IntegerSparseArray(int... dims)
Default constructor.
|
|
IntegerSparseArray(IntegerSparseArray array)
Alternate constructor.
|
protected |
IntegerSparseArray(int unused,
int[] dims)
Internal constructor with a distinctive signature.
|
protected |
IntegerSparseArray(SparseArrayState<int[]> state,
int[] dims,
int[] strides,
int[] dimOffsets)
Internal constructor for package use only.
|
Modifier and Type | Method and Description |
---|---|
protected int[] |
empty()
Gets an empty array of values.
|
Class<Integer> |
getComponentType()
Gets the component type.
|
protected int |
length(int[] values)
Gets the length of the given array.
|
IntegerArray |
toDense()
Converts this array to its dense form.
|
String |
toString()
Creates a human-readable representation of this array.
|
protected IntegerSparseArray |
wrap(Integer value,
int[] dims,
int[] strides,
int[] dimOffsets)
Allocates a new array initialized to the given value.
|
protected IntegerSparseArray |
wrap(SparseArrayState<int[]> state,
int[] dims,
int[] strides,
int[] dimOffsets)
Allocates a new array.
|
public IntegerSparseArray(int... dims)
protected IntegerSparseArray(int unused, int[] dims)
public IntegerSparseArray(IntegerSparseArray array)
protected IntegerSparseArray(SparseArrayState<int[]> state, int[] dims, int[] strides, int[] dimOffsets)
public Class<Integer> getComponentType()
Array
protected IntegerSparseArray wrap(Integer value, int[] dims, int[] strides, int[] dimOffsets)
ProtoSparseArray
wrap
in class ProtoSparseArray<IntegerSparseArray,int[],Integer,IntegerArray>
value
- the initial value.dims
- the dimensions.strides
- the strides.dimOffsets
- the dimension offsets.protected IntegerSparseArray wrap(SparseArrayState<int[]> state, int[] dims, int[] strides, int[] dimOffsets)
ProtoSparseArray
wrap
in class ProtoSparseArray<IntegerSparseArray,int[],Integer,IntegerArray>
state
- the SparseArrayState
.dims
- the dimensions.strides
- the strides.dimOffsets
- the dimension offsets.protected int length(int[] values)
ProtoSparseArray
length
in class ProtoSparseArray<IntegerSparseArray,int[],Integer,IntegerArray>
values
- the array.protected int[] empty()
ProtoSparseArray
empty
in class ProtoSparseArray<IntegerSparseArray,int[],Integer,IntegerArray>
public IntegerArray toDense()
ProtoSparseArray
toDense
in class ProtoSparseArray<IntegerSparseArray,int[],Integer,IntegerArray>