Instance offer a space savings of retaining only the non-zero indices and values. For large array with only a few values set, this offers a huge savings. However, as the cardinality of the array grows in relation to its size, a dense {@code int[]} array will offer better performance in both spaceand time. This is especially true if the sparse array instance approaches a cardinality to size ratio of {@code .5}.
This class offers much better performance than {@link SparseIntArray}, but will use significantly more space as the cardinality increases. In addition, this class will marshall {@code int} primitives into {@code Integer} objects. @see SparseArray @see SparseIntArray
|
|
|
|