protected void updateFilter(final int flag) { String rExpression = createFilter(getColumn().getRExpression()); if (rExpression != null && rExpression.isEmpty()) { rExpression = null; } if ((fFilterRExpression != null) ? fFilterRExpression.equals(rExpression) : null == rExpression) { return; } fFilterRExpression = rExpression; fFilterSet.updateFilter((flag & 1) == 1); }
// returns true if id has properties that match Filter private boolean test(String id, Filter filter) throws UnknownFilterException { if (filter instanceof FilterSet) { FilterSet fs = (FilterSet) filter; for (Filter f2 : fs.getFilters()) { if (!test(id, f2)) { return false; } } return true; } else if (filter instanceof PropertyValueFilter) { PropertyValueFilter fpv = (PropertyValueFilter) filter; Set<Object> values = knowledgeBase.getPropertyValues(id, fpv.getPropertySymbol()); LOG.info(id + " VALs=" + values); boolean contains = false; if (values.contains(fpv.getFiller())) contains = true; if (fpv.isNegated()) return !contains; else return contains; } /* else if (filter instanceof TypeFilter) { //TODO //int tix = knowledgeBase.get ((TypeFilter)filter).getTypeId(); //EWAHCompressedBitmap typeBM = knowledgeBase.getTypesBM(id); //if (typeBM.getPositions().contains(filter)) return false; }*/ else if (filter instanceof IdFilter) { IdFilter idf = (IdFilter) filter; if (idf.getIds().contains(id)) { return true; } else { return false; } } else { throw new UnknownFilterException(filter.toString()); } }
protected void scheduleUpdate() { fUpdateScheduled = true; fFilterSet.scheduleUpdate(false); }
protected void runInRealm(final Runnable runnable) { fFilterSet.runInRealm(runnable); }