Class CalendarCache


  • public class CalendarCache
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int arraySize  
      static long EMPTY  
      private long[] keys  
      private int pIndex  
      private static int[] primes  
      private int size  
      private int threshold  
      private long[] values  
    • Constructor Summary

      Constructors 
      Constructor Description
      CalendarCache()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private int findIndex​(long key)  
      long get​(long key)  
      private int hash​(long key)
      Produce a uniformly-distributed hash value from an integer key.
      private int hash2​(long key)  
      private void makeArrays​(int newSize)  
      void put​(long key, long value)  
      private void rehash()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • primes

        private static final int[] primes
      • pIndex

        private int pIndex
      • size

        private int size
      • arraySize

        private int arraySize
      • threshold

        private int threshold
      • keys

        private long[] keys
      • values

        private long[] values
      • EMPTY

        public static long EMPTY
    • Constructor Detail

      • CalendarCache

        public CalendarCache()
    • Method Detail

      • makeArrays

        private void makeArrays​(int newSize)
      • get

        public long get​(long key)
      • put

        public void put​(long key,
                        long value)
      • findIndex

        private final int findIndex​(long key)
      • rehash

        private void rehash()
      • hash

        private final int hash​(long key)
        Produce a uniformly-distributed hash value from an integer key. This is essentially a linear congruential random number generator that uses the key as its seed value.
      • hash2

        private final int hash2​(long key)