public void checkForValue(final double VALUE){
  boolean wasSmaller=Double.compare(checkedValue,VALUE) < 0;
  boolean wasBigger=Double.compare(checkedValue,VALUE) > 0;
  boolean isBigger=Double.compare(VALUE,checkedValue) > 0;
  boolean isSmaller=Double.compare(VALUE,checkedValue) < 0;
  if (wasSmaller && isBigger) {
    fireMarkerEvent(EXCEEDED_EVENT);
  }
 else   if (wasBigger && isSmaller) {
    fireMarkerEvent(UNDERRUN_EVENT);
  }
  checkedValue=VALUE;
}

public void checkForValue ( final double VALUE ) { boolean wasSmaller = Double . compare ( checkedValue , VALUE ) < 0 ; boolean wasBigger = Double . compare ( checkedValue , VALUE ) > 0 ; boolean isBigger = Double . compare ( VALUE , checkedValue ) > 0 ; boolean isSmaller = Double . compare ( VALUE , checkedValue ) < 0 ; if ( wasSmaller && isBigger ) { fireMarkerEvent ( EXCEEDED_EVENT ) ; } else if ( wasBigger && isSmaller ) { fireMarkerEvent ( UNDERRUN_EVENT ) ; } checkedValue = VALUE ; }
checks if a given value is smaller / bigger than the stored value . with those checks it can be detected if the current value exceeds or underruns the marker . in both cases an event will be fired .
