public long result() { if (keyList == null || keyList.isEmpty()) { return 0; } // if any specified key not in map, the intersection must be 0 for (Object key : keyList) { if (!map.containsKey(key)) { return 0; } } BitmapCounter counter = null; for (Object key : keyList) { BitmapCounter c = map.get(key); if (counter == null) { counter = factory.newBitmap(); counter.orWith(c); } else { counter.andWith(c); } } return counter != null ? counter.getCount() : 0; } }
public long result() { if (keyList == null || keyList.isEmpty()) { return 0; } // if any specified key not in map, the intersection must be 0 for (Object key : keyList) { if (!map.containsKey(key)) { return 0; } } BitmapCounter counter = null; for (Object key : keyList) { BitmapCounter c = map.get(key); if (counter == null) { counter = factory.newBitmap(); counter.orWith(c); } else { counter.andWith(c); } } return counter != null ? counter.getCount() : 0; } }