public ArrayList<F> findFilters(IntentFilter matching) { if (matching.countDataSchemes() == 1) { // Fast case. return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching); } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) { // Another fast case. return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching); } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) { // Last fast case. return collectFilters(mActionToFilter.get(matching.getAction(0)), matching); } else { ArrayList<F> res = null; for (F cur : mFilters) { if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } return res; } }
public ArrayList<F> findFilters(IntentFilter matching) { if (matching.countDataSchemes() == 1) { // Fast case. return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching); } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) { // Another fast case. return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching); } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) { // Last fast case. return collectFilters(mActionToFilter.get(matching.getAction(0)), matching); } else { ArrayList<F> res = null; for (F cur : mFilters) { if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } return res; } }
public ArrayList<F> findFilters(IntentFilter matching) { if (matching.countDataSchemes() == 1) { // Fast case. return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching); } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) { // Another fast case. return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching); } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) { // Last fast case. return collectFilters(mActionToFilter.get(matching.getAction(0)), matching); } else { ArrayList<F> res = null; for (F cur : mFilters) { if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } return res; } }