/** * Get all rules that are relevant for an event type. * @param event The event type. * @return The rules. */ public List<IRule<?>> getRules(EventType event) { // if(event.equals("factchanged.environment")) // System.out.println("ff"); return matcher==null? null: matcher.getRules(event); }
/** * Get the rules for an event type. * @param type The event type. * @return The list of rules relevant for the event type. */ public List<IRule<?>> getRules(EventType type) { List<IRule<?>> ret = new ArrayList<IRule<?>>(); getRules(type, 0, ret); return ret; }
/** * Get the rules for an event type (as string, delim is .) * @param type The event type. * @return The list of rules relevant for the event type. */ public List<IRule<?>> getRules(String type) { return getRules(new EventType(type)); }
/** * Get the rules for an event type at level i. * @param type The event type. * @param i The level. */ protected void getRules(EventType type, int i, List<IRule<?>> ret) { String[] subtypes = type.getTypes(); if(i+1==subtypes.length) { List<IRule<?>> tmp = internalGetRules(subtypes[i]); if(tmp!=null) ret.addAll(tmp); } else { MatcherNode node = getChild(subtypes[i]); if(node!=null) node.getRules(type, i+1, ret); } List<IRule<?>> tmp = internalGetRules("*"); if(tmp!=null) ret.addAll(tmp); }