Android SparseBooleanArray Convert toMap(SparseBooleanArray array)

Here you can find the source of toMap(SparseBooleanArray array)

Description

to Map

License

Apache License

Declaration

public static Map<Integer, Boolean> toMap(SparseBooleanArray array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Map;

import android.util.SparseBooleanArray;
import com.google.common.collect.Maps;

public class Main {
    public static Map<Integer, Boolean> toMap(SparseBooleanArray array) {
        Map<Integer, Boolean> map = Maps.newHashMap();
        for (int i = 0; i < array.size(); i++) {
            map.put(array.keyAt(i), array.valueAt(i));
        }/*  ww w .j  a v a  2 s  .c o  m*/
        return map;
    }
}

Related

  1. toSet(SparseBooleanArray array)