Class SizedTimeoutCache<K,V>

java.lang.Object
com.hypixel.hytale.server.worldgen.util.cache.SizedTimeoutCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class SizedTimeoutCache<K,V> extends Object implements Cache<K,V>
  • Field Details

  • Constructor Details

    • SizedTimeoutCache

      public SizedTimeoutCache(long expire, @Nonnull TimeUnit unit, int maxSize, @Nullable Function<K,V> func, @Nullable BiConsumer<K,V> destroyer)
  • Method Details

    • cleanup

      public void cleanup()
      Specified by:
      cleanup in interface Cache<K,V>
    • reduceLength

      private void reduceLength(int targetSize)
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface Cache<K,V>
    • get

      @Nullable public V get(K key)
      Specified by:
      get in interface Cache<K,V>
    • put

      public void put(K key, V value)
    • getWithReusedKey

      @Nullable public V getWithReusedKey(K reusedKey, @Nonnull Function<K,K> keyPool)