Code example for SparseArray

Methods: get, keyAt, size

0
     *  
     * @param a 
     * @return 
     */ 
    public int fullKeyAt(int a) {
        return map.keyAt(a);
    } 
 
    /** 
     * What is the key at the given index ? 
     *  
     * @param a 
     *            index for the first dimension 
     * @param b 
     *            index for the second dimension 
     * @return The key associated with <i>b</i>. 
     */ 
    public int fullKeyAt(int a, int b) {
        return fullValueAt(a).keyAt(b);
    } 
 
    /** 
     * What is the key at the given index ? 
     *  
     * @param a 
     *            index for the first dimension 
     * @param b 
     *            index for the second dimension 
     * @param c 
     *            index for the third dimension 
     * @return The key associated with <i>c</i>. 
     */ 
    public int fullKeyAt(int a, int b, int c) {
        return fullValueAt(a, b).keyAt(c);
    } 
 
    public int fullKeyAt(int a, int b, int c, int d) {
        return fullValueAt(a, b, c).keyAt(d);
    } 
 
    public int fullSizeAt(int a) {
        return size(fullKeyAt(a));
    } 
 
    public int fullSizeAt(int a, int b) {
        return size(a, fullKeyAt(a, b));
    } 
 
    public int fullSizeAt(int a, int b, int c) {
        return size(a, b, fullKeyAt(a, b, c));
    } 
 
    public SparseArray<SparseArray<SparseArray<T>>> fullValueAt(int a) {
        return valueAt(a);
    } 
 
    public SparseArray<SparseArray<T>> fullValueAt(int a, int b) {
        return fullValueAt(a).valueAt(b);
    } 
 
    public SparseArray<T> fullValueAt(int a, int b, int c) {
        return fullValueAt(a, b).valueAt(c);
    } 
 
    public T fullValueAt(int a, int b, int c, int d) {
        return fullValueAt(a, b, c).valueAt(d);
    } 
 
    SparseArray<SparseArray<SparseArray<T>>> get(int a) {
        SparseArray<SparseArray<SparseArray<T>>> result = map.get(a);
        if (result == null) {
            result = new SparseArray<SparseArray<SparseArray<T>>>();
            map.put(a, result);
        } 
        return result;
    } 
 
    SparseArray<SparseArray<T>> get(int a, int b) {
        SparseArray<SparseArray<T>> result = get(a).get(b);
        if (result == null) {
            result = new SparseArray<SparseArray<T>>();
            get(a).put(b, result);
        } 
        return result;
    } 
 
    SparseArray<T> get(int a, int b, int c) {
        SparseArray<T> result = get(a, b).get(c);
        if (result == null) {
            result = new SparseArray<T>();
            get(a, b).put(c, result);
        } 
        return result;
    } 
 
    public T get(int a, int b, int c, int d) {
        return get(a, b, c).get(d);
    } 
 
    public T get(Point A, Point B) {
        return get(A.x, A.y, B.x, B.y);
    } 
 
    public int keyAt(int index) {
        return map.keyAt(index);
    } 
 
    public int keyAt(int a, int index) {
        return get(a).keyAt(index);
    } 
 
    public int keyAt(int a, int b, int index) {
        return get(a, b).keyAt(index);
    } 
 
    public int keyAt(int a, int b, int c, int index) {
        return get(a, b, c).keyAt(index);
    } 
 
    public void put(int a, int b, int c, int d, T value) {
        get(a, b, c).put(d, value);
    } 
 
    public void put(Point A, Point B, T value) {
        put(A.x, A.y, B.x, B.y, value);
    } 
 
    public int size() { 
        return map.size();
    } 
 
    public int size(int a) {
        return get(a).size();
    } 
 
    public int size(int a, int b) {
        return get(a, b).size();
    }