Class IntObjectCache<T>

  • All Implemented Interfaces:
    Iterable<T>

    public class IntObjectCache<T>
    extends Object
    implements Iterable<T>
    Author:
    lvo
    • Constructor Detail

      • IntObjectCache

        public IntObjectCache()
      • IntObjectCache

        public IntObjectCache​(int cacheSize)
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • containsKey

        public boolean containsKey​(int key)
      • get

        public T get​(int key)
      • put

        public T put​(int key,
                     T value)
      • remove

        public void remove​(int key)
      • removeAll

        public void removeAll()
      • cacheObject

        public final void cacheObject​(int key,
                                      T x)
      • tryKey

        public final T tryKey​(int key)
      • isCached

        public final boolean isCached​(int key)
      • count

        public int count()
      • size

        public int size()
      • resize

        public void resize​(int newSize)
      • hitRate

        public double hitRate()
      • getAdjustedTableSize

        protected static int getAdjustedTableSize​(int candidate)