* @param map trigger map to cull from
* @param lpsToActivate set of LPs to be activated, added to by this call
* @return culled Trigger map; should replace the map passed in
*/
private IdentityHashMap cullTriggers(IdentityHashMap map, HashSet lpsToActivate) {
IdentityHashMap stillWaiting = new IdentityHashMap();
for (Iterator i = map.keySet().iterator(); i.hasNext(); ) {
Trigger t = (Trigger)i.next();
if (t.condition()) {
ArrayList lps = (ArrayList)map.get(t);
for (Iterator lpi = lps.iterator(); lpi.hasNext(); ) {
LogicalProcess lp = (LogicalProcess)lpi.next();
lp.setSelectedTrigger(t);
lp.setTriggerOccurred(true);
}
t.action();
if (!lps.isEmpty()) lpsToActivate.addAll(lps);
}
else {
stillWaiting.put(t, map.get(t));
}
}
return stillWaiting;
}