Example usage for com.fasterxml.jackson.databind.util LRUMap LRUMap

List of usage examples for com.fasterxml.jackson.databind.util LRUMap LRUMap

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.util LRUMap LRUMap.

Prototype

public LRUMap(int paramInt1, int paramInt2) 

Source Link

Usage

From source file:org.apache.tika.language.translate.CachedTranslator.java

/**
 * Get the cache of translations from the given source language to target language.
 *
 * @param sourceLanguage The source language of translation.
 * @param targetLanguage The target language of translation.
 * @return The LRUMap representing the translation cache.
 *///from   w w w  .ja  v a  2  s  . c  o m
private LRUMap<String, String> getTranslationCache(String sourceLanguage, String targetLanguage) {
    LRUMap<String, String> translationCache = cache.get(buildCacheKeyString(sourceLanguage, targetLanguage));
    if (translationCache == null) {
        translationCache = new LRUMap<String, String>(INITIAL_ENTRIES, MAX_ENTRIES);
        cache.put(buildCacheKeyString(sourceLanguage, targetLanguage), translationCache);
    }
    return translationCache;
}