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

com.clickntap.tool.cache.MemoryLruMap Maven / Gradle / Ivy

The newest version!
package com.clickntap.tool.cache;

import java.util.LinkedHashMap;

public class MemoryLruMap extends LinkedHashMap {
  private int capacity;

  public MemoryLruMap(int capacity) {
    super(capacity + 1, 1.0f, true);
    this.capacity = capacity;
  }

  protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
    return (size() > this.capacity);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy