@SuppressWarnings("unused") public int GetMatchCountFromPartial(HashMap<PVariable, Object> MatchingVariables) { if (true || innerFindCall .getReferredQuery() .getAllAnnotations() .contains(new PAnnotation("incremental"))) { int result = treatPatternCacher.GetMatchCountFromPartial( innerFindCall.getReferredQuery(), MatchingVariables, affectedVariables, false); // result must be parsed to List<Object[]> return result; } // will throw exception!?: return -1; }
public FindConstraint(PositivePatternCall findCons, IPartialPatternCacher treatPatternCacher) { this.treatPatternCacher = treatPatternCacher; this.innerFindCall = findCons; // and affecteds from tuple (order needed!) Tuple tup = findCons.getVariablesTuple(); this.affectedVariables = new ArrayList<PVariable>(); for (int i = 0; i < tup.getSize(); i++) { this.affectedVariables.add((PVariable) tup.get(i)); } }
@SuppressWarnings("unused") public List<Object[]> GetMatchingsFromPartial(HashMap<PVariable, Object> MatchingVariables) { if (true || innerFindCall .getReferredQuery() .getAllAnnotations() .contains(new PAnnotation("incremental"))) { Multiset<LookaheadMatching> result = treatPatternCacher.GetMatchingsFromPartial( innerFindCall.getReferredQuery(), MatchingVariables, affectedVariables, false); // result must be parsed to List<Object[]> List<Object[]> ret = new ArrayList<Object[]>(); // toarraylist false because only REAL matches count as a match, no need to count // local-duplicated matches multiple mode for (LookaheadMatching match : result.elementSet()) // .toArrayList(false)) { // add all matchings as a "line" multi-matches only once ret.add(match.getParameterMatchValuesOnlyAsArray().toArray()); } return ret; } return null; }