Пример #1
0
  private boolean eventuallyLoadFurtherValues(
      final String source,
      final FDate key,
      final FDate adjustedKey,
      final boolean newMinKey,
      final boolean forced) {
    if (forced || shouldLoadFurtherValues(key, newMinKey)) {
      final FDate keyForReadAllValues;
      if (newMinKey
          && minKeyInDBFromLoadFurtherValues != null
          && key.isBefore(minKeyInDBFromLoadFurtherValues)) {
        // performance optimization for first load
        keyForReadAllValues = FDates.min(minKeyInDB, FDates.max(minKeyInDB, adjustedKey));
      } else {
        keyForReadAllValues = FDates.max(minKeyInDB, adjustedKey);
      }
      furtherValues.clear();
      lastValuesFromFurtherValues.clear();
      furtherValues.addAll(readAllValuesAscendingFrom(keyForReadAllValues));

      if (!furtherValues.isEmpty()) {
        assertFurtherValuesSorting(key);
      }
      return true;
    }
    return false;
  }
Пример #2
0
 @Override
 public synchronized void clear() {
   super.clear();
   // remove flags so that the limit check gets skipped if get has not been called yet and this
   // method might be called again
   maxKeyInDB = null;
   minKeyInDB = null;
   // a clear forces the list to be completely reloaded next time get is called
   furtherValues.clear();
   lastValuesFromFurtherValues.clear();
 }