Class RecentEntriesCache<K,​V>


  • public class RecentEntriesCache<K,​V>
    extends java.lang.Object
    Author:
    Pavel.Sher Date: 26.05.2008
    • Constructor Detail

      • RecentEntriesCache

        public RecentEntriesCache​(int maxEntries)
      • RecentEntriesCache

        public RecentEntriesCache​(int maxEntries,
                                  boolean rememberNullValues)
      • RecentEntriesCache

        public RecentEntriesCache​(@NotNull
                                  java.lang.String cacheName,
                                  int maxEntries)
      • RecentEntriesCache

        public RecentEntriesCache​(@NotNull
                                  java.lang.String cacheName,
                                  int maxEntries,
                                  boolean rememberNullValues)
        Constructor.
        Parameters:
        maxEntries - max entries to hold in cache
        rememberNullValues - whether to accept null values or not
    • Method Detail

      • size

        public int size()
        Returns:
        number of elements in the cache
        Since:
        7.0
      • isEmpty

        public boolean isEmpty()
        Returns:
        true of cache is empty
        Since:
        7.0
      • get

        @Nullable
        public V get​(@NotNull
                     K key)
      • getAll

        @NotNull
        public java.util.Collection<V> getAll​(@NotNull
                                              java.util.Collection<K> keys)
      • put

        public void put​(@NotNull
                        K key,
                        V value)
      • keySet

        @NotNull
        public java.util.Set<K> keySet()
      • clear

        public void clear()
      • remove

        public void remove​(@NotNull
                           K key)
      • removeValues

        public void removeValues​(@NotNull
                                 Filter<V> valueFilter)
      • forEach

        public void forEach​(@NotNull
                            ItemProcessor<V> processor)
      • copyEntries

        public java.util.Map<K,​V> copyEntries()
      • getHitRate

        public float getHitRate()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object