package

androidx.collection

Overview

A set of collection libraries suited for small data sets which are also optimized for Android, usually by sacrificing performance for efficiency in memory.

  • ArraySet / ArrayMap

    Implementations of java.util.Set and java.util.Map, respectively, which are backed by an array with lookups done by a binary search.

  • SparseArrayCompat / LongSparseArray

    Map-like structures whose keys are int and long, respectively, which prevents boxing compared to a traditional java.util.Map.

  • LruCache

    A map-like cache which keeps frequently-used entries and automatically evicts others.

  • CircularArray / CircularIntArray

    List-like structures which can efficiently prepend and append elements.

Classes

ArrayMap<K, V>ArrayMap is a generic key->value mapping data structure that is designed to be more memory efficient than a traditional java.util.HashMap, this implementation is a version of the platform's android.util.ArrayMap that can be used on older versions of the platform.
ArraySet<E>ArraySet is a generic set data structure that is designed to be more memory efficient than a traditional java.util.HashSet.
CircularArray<E>CircularArray is a generic circular array data structure that provides O(1) random read, O(1) prepend and O(1) append.
CircularIntArrayCircularIntArray is a circular integer array data structure that provides O(1) random read, O(1) prepend and O(1) append.
LongSparseArray<E>SparseArray mapping longs to Objects.
LruCache<K, V>Static library version of android.util.LruCache.
SimpleArrayMap<K, V>Base implementation of ArrayMap that doesn't include any standard Java container API interoperability.
SparseArrayCompat<E>SparseArrays map integers to Objects.