Tabnine Logo
LoadingCache.getUnchecked
Code IndexAdd Tabnine to your IDE (free)

How to use
getUnchecked
method
in
com.nytimes.android.external.cache3.LoadingCache

Best Java code snippets using com.nytimes.android.external.cache3.LoadingCache.getUnchecked (Showing top 3 results out of 315)

origin: com.nytimes.android/cache3

@Override
public V getUnchecked(K key) {
  return autoDelegate.getUnchecked(key);
}
origin: com.nytimes.android/filesystem3

@Nullable
private FSFile getFile(@Nonnull String path) {
  return files.getUnchecked(cleanPath(path));
}
origin: com.nytimes.android/filesystem3

  @Nonnull
  private Collection<FSFile> findFiles(@Nonnull String path) throws FileNotFoundException {
    File searchRoot = new File(root, util.simplifyPath(path));
    if (searchRoot.exists() && searchRoot.isFile()) {
      throw new FileNotFoundException(format("expecting a directory at %s, instead found a file", path));
    }

    Collection<FSFile> foundFiles = new ArrayList<>();
    BreadthFirstFileTreeIterator iterator = new BreadthFirstFileTreeIterator(searchRoot);
    while (iterator.hasNext()) {
      File file = (File) iterator.next();
      foundFiles.add(files.getUnchecked(util.simplifyPath(file.getPath()
          .replaceFirst(root.getPath(), ""))));
    }
    return foundFiles;
  }
}
com.nytimes.android.external.cache3LoadingCachegetUnchecked

Javadoc

Returns the value associated with key in this cache, first loading that value if necessary. No observable state associated with this cache is modified until loading completes. Unlike #get, this method does not throw a checked exception, and thus should only be used in situations where checked exceptions are not thrown by the cache loader.

If another call to #get or #getUnchecked is currently loading the value for key, simply waits for that thread to finish and returns its loaded value. Note that multiple threads can concurrently load values for distinct keys.

Caches loaded by a CacheLoader will call CacheLoader#load to load new values into the cache. Newly loaded values are added to the cache using Cache.asMap().putIfAbsent after loading has completed; if another value was associated with key while the new value was loading then a removal notification will be sent for the new value.

Warning: this method silently converts checked exceptions to unchecked exceptions, and should not be used with cache loaders which throw checked exceptions. In such cases use #get instead.

Popular methods of LoadingCache

  • apply
  • get
    Returns the value associated with key in this cache, first loading that value if necessary. No obser
  • getAll
    Returns a map of the values associated with keys, creating or retrieving those values if necessary.
  • refresh
    Loads a new value for key key, possibly asynchronously. While the new value is loading the previous

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now