public void scoreBoardChange(ScoreBoardEvent event) {
   if (isEnabled()) {
     synchronized (changeLock) {
       clockChange((Clock) event.getProvider(), event.getValue());
     }
   }
 }
Ejemplo n.º 2
0
 public boolean checkCondition(String format, ScoreBoardEvent event) {
   boolean triggerCondition = true;
   Matcher m = conditionPattern.matcher(format);
   if (!m.find()) throw new IllegalArgumentException("No conditions in format : " + format);
   do {
     String specifier = m.group(1);
     String comparator = m.group(2);
     String targetValue = m.group(3);
     if (null == comparator || null == targetValue) continue;
     String value = scoreBoardValues.get(specifier).getValue();
     if (triggerCondition) {
       triggerCondition = false;
       // If current trigger event value == previous value after processing
       // (e.g. conversion to min:sec) then ignore, to prevent multiple consecutive
       // identical triggers
       if (value.equals(
           scoreBoardValues.get(specifier).getPreviousValue(event.getPreviousValue())))
         return false;
     }
     try {
       if (!checkConditionValue(value, comparator, targetValue)) return false;
     } catch (IllegalArgumentException iaE) {
       return false;
     }
   } while (m.find());
   return true;
 }