Interface DynamicMap

All Known Implementing Classes:
IntFloatDynamicMap, IntIntDynamicMap, IntLongDynamicMap

public interface DynamicMap
An efficient map for storing keys as integer in range from 0..n with n can be estimated up-front. By automatically switching from a hashMap (which is memory efficient) to an array (which is faster) on increasing number of keys. So it SHOULD not be used for other cases where key can be any arbitrary integer.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    mapExpectedElements(int expectedKeyMax)
    Compute expected elements for hppc maps, so resizing won't happen if we store less elements than threshold
    default int
    threshold(int expectedKeyMax)
    Compute threshold for switching from hashMap based to array
    default boolean
    useArrayBased(int expectedKeyMax)
     
  • Method Details

    • useArrayBased

      default boolean useArrayBased(int expectedKeyMax)
    • threshold

      default int threshold(int expectedKeyMax)
      Compute threshold for switching from hashMap based to array
    • mapExpectedElements

      default int mapExpectedElements(int expectedKeyMax)
      Compute expected elements for hppc maps, so resizing won't happen if we store less elements than threshold