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

eu.erasmuswithoutpaper.rsaaes.LruCache Maven / Gradle / Ivy

Go to download

Encrypt and decrypts data using the ewp-rsa-aes128gcm encryption scheme, as defined here: https://github.com/erasmus-without-paper/ewp-specs-sec-rsa-aes128gcm

There is a newer version: 1.0.1
Show newest version
package eu.erasmuswithoutpaper.rsaaes;

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

class LruCache extends LinkedHashMap {

  private static final long serialVersionUID = 1L;

  private final int maxEntries;

  LruCache(int maxEntries) {
    super((int) (maxEntries * 1.3f + 1), 0.75f, true);
    this.maxEntries = maxEntries;
  }

  @Override
  protected boolean removeEldestEntry(Map.Entry eldest) {
    return this.size() > this.maxEntries;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy