Code example for SparseArray

Methods: indexOfValue

0
    public T GetEntity(int itemIndex) {
        return map.get(itemIndex);
    } 
 
    public int GetItemIndex(T entity) {
        return map.indexOfValue(entity);
    } 
 
    public void Update() { 
        names = new ArrayList<String>();
        map = new SparseArray<T>();
    } 
 
    public List<String> GetData() {
        return names;
    } 
}