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

gw.util.LRUCache Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
/*
 * Copyright 2014 Guidewire Software, Inc.
 */

package gw.util;

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

/**
 */
public class LRUCache extends LinkedHashMap {
  private final int _maxSize;

  public LRUCache(int maxSize) {
    _maxSize = maxSize;
  }

  protected boolean removeEldestEntry(Map.Entry eldest) {
    return size() > _maxSize;
  }

  public int getMaxSize() {
    return _maxSize;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy