java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
net.i2p.router.web.helpers.TunnelRenderer.BoundedCache<K,V>
Type Parameters:
K - the key type of the cached entries
V - the value type stored under each key
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, SequencedMap<K,V>
Enclosing class:
TunnelRenderer

private static class TunnelRenderer.BoundedCache<K,V>extends LinkedHashMap<K,V>
A bounded LRU cache extending LinkedHashMap with computeIfAbsent support.
  • Field Details

    • _maxSize

      private final int _maxSize
      Entries the cache holds before dropping the oldest.
  • Constructor Details

    • BoundedCache

      public BoundedCache(int maxSize)
      Builds a cache with a size limit.
      Parameters:
      maxSize - the entries to keep
  • Method Details