All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.hsac.fitnesse.fixture.util.CacheHelper Maven / Gradle / Ivy

package nl.hsac.fitnesse.fixture.util;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Helper to obtain caches.
 */
public class CacheHelper {
    public static  Map lruCache(final int maxSize) {
        return new LinkedHashMap(maxSize * 4 / 3, 0.75f, true) {
            @Override
            protected boolean removeEldestEntry(Map.Entry eldest) {
                return size() > maxSize;
            }
        };
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy