Class TickBasedCache<K,V>

java.lang.Object
com.simibubi.create.foundation.utility.TickBasedCache<K,V>
All Implemented Interfaces:
com.google.common.cache.Cache<K,V>

public class TickBasedCache<K,V> extends Object implements com.google.common.cache.Cache<K,V>
  • Constructor Details

    • TickBasedCache

      public TickBasedCache(int ticksUntilTimeout, boolean resetTimerOnAccess)
    • TickBasedCache

      public TickBasedCache(int ticksUntilTimeout, boolean resetTimerOnAccess, boolean clientSide)
  • Method Details

    • tick

      public static void tick()
    • clientTick

      public static void clientTick()
    • getIfPresent

      public V getIfPresent(Object key)
      Specified by:
      getIfPresent in interface com.google.common.cache.Cache<K,V>
    • ticks

      public int ticks()
    • get

      public V get(K key, Callable<? extends V> loader) throws ExecutionException
      Specified by:
      get in interface com.google.common.cache.Cache<K,V>
      Throws:
      ExecutionException
    • getAllPresent

      public com.google.common.collect.ImmutableMap<K,V> getAllPresent(Iterable<? extends Object> keys)
      Specified by:
      getAllPresent in interface com.google.common.cache.Cache<K,V>
    • put

      public void put(K key, V value)
      Specified by:
      put in interface com.google.common.cache.Cache<K,V>
    • putAll

      public void putAll(Map<? extends K,? extends V> m)
      Specified by:
      putAll in interface com.google.common.cache.Cache<K,V>
    • invalidate

      public void invalidate(Object key)
      Specified by:
      invalidate in interface com.google.common.cache.Cache<K,V>
    • invalidateAll

      public void invalidateAll(Iterable<? extends Object> keys)
      Specified by:
      invalidateAll in interface com.google.common.cache.Cache<K,V>
    • invalidateAll

      public void invalidateAll()
      Specified by:
      invalidateAll in interface com.google.common.cache.Cache<K,V>
    • size

      public long size()
      Specified by:
      size in interface com.google.common.cache.Cache<K,V>
    • stats

      public com.google.common.cache.CacheStats stats()
      Specified by:
      stats in interface com.google.common.cache.Cache<K,V>
    • asMap

      public ConcurrentMap<K,V> asMap()
      Specified by:
      asMap in interface com.google.common.cache.Cache<K,V>
    • cleanUp

      public void cleanUp()
      Specified by:
      cleanUp in interface com.google.common.cache.Cache<K,V>