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