Class OpenAddressedCanonicalizationCache

java.lang.Object
io.deephaven.base.cache.OpenAddressedCanonicalizationCache

public class OpenAddressedCanonicalizationCache extends Object
An object canonicalization cache, suitable for use with objects that define equals(...) in such a way as to identify objects that can be mutually substituted in a manner appropriate for the application using the cache. Objects with an improper hashCode() implementation will cause undefined behavior. See KeyedObjectHashMap and its parent classes for many of the ideas I'm working from. The implementation is (loosely) based on an open-addressed hash map. The intended problem domain is effectively single-threaded, so I've optimized on single-threaded efficiency and used coarse synchronization instead of optimizing for concurrency.
  • Constructor Details

    • OpenAddressedCanonicalizationCache

      public OpenAddressedCanonicalizationCache(int minimumInitialCapacity, float loadFactor)
    • OpenAddressedCanonicalizationCache

      public OpenAddressedCanonicalizationCache(int minimumInitialCapacity)
    • OpenAddressedCanonicalizationCache

      public OpenAddressedCanonicalizationCache()
  • Method Details

    • getCachedItem

      public <INPUT_OUTPUT_TYPE> INPUT_OUTPUT_TYPE getCachedItem(@NotNull INPUT_OUTPUT_TYPE item)
    • getCachedItem

      public <INPUT_TYPE, OUTPUT_TYPE> OUTPUT_TYPE getCachedItem(@NotNull INPUT_TYPE item, @NotNull @NotNull OpenAddressedCanonicalizationCache.Adapter<INPUT_TYPE,OUTPUT_TYPE> adapter)