Class IntegerKeyStore<T>


  • class IntegerKeyStore<T>
    extends java.lang.Object
    A simple compact data structure to model a sparse array
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.Integer,​java.util.ArrayList<T>> arrays  
      private static int RANGE_BIT_SIZE  
      private static int RANGE_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      IntegerKeyStore()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get​(java.lang.Integer index)  
      void put​(java.lang.Integer index, T value)  
      • Methods inherited from class java.lang.Object

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

      • arrays

        private final java.util.Map<java.lang.Integer,​java.util.ArrayList<T>> arrays
    • Constructor Detail

      • IntegerKeyStore

        IntegerKeyStore()
    • Method Detail

      • put

        public void put​(java.lang.Integer index,
                        T value)
        Parameters:
        index - a positive integer
        value - value to store
      • get

        public T get​(java.lang.Integer index)
        Parameters:
        index - a positive integer
        Returns:
        value the value associated with the index or null