BaseMatcher matcher = createMatcher();
Object person = createPerson();
final int[] matchCount = new int[1];
FilterSubscription filterSubscription = matcher.registerFilter(queryString, new FilterCallback() {
@Override
public void onFilterResult(Object instance, Object[] projection, boolean isMatching) {
if (isMatching) {
matchCount[0]++;
}
}
});
// create a sub-matcher with a single filter
final int[] matchCount2 = new int[1];
Matcher subMatcher = matcher.getSingleFilterMatcher(filterSubscription, new FilterCallback() {
@Override
public void onFilterResult(Object instance, Object[] projection, boolean isMatching) {
if (isMatching) {
matchCount2[0]++;
}