private ArrayList<F> collectFilters(F[] array, IntentFilter matching) { ArrayList<F> res = null; if (array != null) { for (int i = 0; i < array.length; i++) { F cur = array[i]; if (cur == null) { break; } 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; } }
private ArrayList<F> collectFilters(F[] array, IntentFilter matching) { ArrayList<F> res = null; if (array != null) { for (int i = 0; i < array.length; i++) { F cur = array[i]; if (cur == null) { break; } if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } } return res; }
private ArrayList<F> collectFilters(F[] array, IntentFilter matching) { ArrayList<F> res = null; if (array != null) { for (int i = 0; i < array.length; i++) { F cur = array[i]; if (cur == null) { break; } 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; } }