Class LRUCache<K,V>

java.lang.Object
tigase.pubsub.utils.LRUCache<K,V>
All Implemented Interfaces:
Cache<K,V>, tigase.stats.StatisticHolder

public class LRUCache<K,V> extends Object implements Cache<K,V>
  • Constructor Details

    • LRUCache

      public LRUCache()
    • LRUCache

      public LRUCache(int maxSize)
  • Method Details

    • computeIfAbsent

      public V computeIfAbsent(K key, Cache.CacheSupplier<V> supplier) throws Cache.CacheException
      Specified by:
      computeIfAbsent in interface Cache<K,V>
      Throws:
      Cache.CacheException
    • get

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

      public V put(K key, V value)
      Specified by:
      put in interface Cache<K,V>
    • putIfAbsent

      public V putIfAbsent(K key, V value)
      Specified by:
      putIfAbsent in interface Cache<K,V>
    • remove

      public V remove(K key)
      Specified by:
      remove in interface Cache<K,V>
    • remove

      public boolean remove(K key, V value)
    • keySet

      public Set<K> keySet()
      Specified by:
      keySet in interface Cache<K,V>
    • values

      public Stream<V> values()
      Specified by:
      values in interface Cache<K,V>
    • size

      public int size()
      Specified by:
      size in interface Cache<K,V>
    • setMaxSize

      public void setMaxSize(int size)
      Specified by:
      setMaxSize in interface Cache<K,V>
    • everyHour

      public void everyHour()
      Specified by:
      everyHour in interface tigase.stats.StatisticHolder
    • everyMinute

      public void everyMinute()
      Specified by:
      everyMinute in interface tigase.stats.StatisticHolder
    • everySecond

      public void everySecond()
      Specified by:
      everySecond in interface tigase.stats.StatisticHolder
    • getStatistics

      public void getStatistics(String compName, tigase.stats.StatisticsList list)
      Specified by:
      getStatistics in interface tigase.stats.StatisticHolder
    • setStatisticsPrefix

      public void setStatisticsPrefix(String prefix)
      Specified by:
      setStatisticsPrefix in interface tigase.stats.StatisticHolder
    • statisticExecutedIn

      public void statisticExecutedIn(long executionTime)
      Specified by:
      statisticExecutedIn in interface tigase.stats.StatisticHolder