code: public boolean setSampleRate(int rate) {
      boolean result = (rate <= MAX_SAMPLE_RATE && rate >= MIN_SAMPLE_RATE);
      sampleRate = rate;
      return result;
    }
docs: Set the sample rate. Because this is not a value that may be
  guessed and corrected, the value will be set to that given even if it is
  not valid.
  @param rate sample rate(in Hz)
  @return true if given rate was within the valid range, false otherwise.