List of utility methods to do SparseBooleanArray Convert
Map | toMap(SparseBooleanArray array) to Map Map<Integer, Boolean> map = Maps.newHashMap(); for (int i = 0; i < array.size(); i++) { map.put(array.keyAt(i), array.valueAt(i)); return map; |
Set | toSet(SparseBooleanArray array) to Set Set<Integer> trueSet = Sets.newHashSet(); for (int i = 0; i < array.size(); i++) { if (array.valueAt(i)) { int position = array.keyAt(i); trueSet.add(position); return trueSet; ... |