Interface OffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>

All Known Implementing Classes:
ArrayBackedOffsetLookupCache, BaseOffsetLookupCache, BoundedArrayBackedOffsetLookupCache, ReversibleCache, SoftArrayBackedOffsetLookupCache

public interface OffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>
Caching data structure interface for caching int (offset) to Object mappings.
  • Method Summary

    Modifier and Type Method Description
    void clear()
    Release all resources held by the cache.
    static <VALUE_TYPE>
    VALUE_TYPE
    createPlaceholder​(Class<VALUE_TYPE> valueType)
    Attempt to instantiate an instance of valueType with the nullary constructor, in order to create a placeholder instance reference.
    VALUE_TYPE get​(long index, EXTRA_INPUT_TYPE extra)
    Lookup the value for index.
  • Method Details

    • get

      VALUE_TYPE get​(long index, EXTRA_INPUT_TYPE extra)
      Lookup the value for index.
      Parameters:
      index - The offset (must be >= 0)
      Returns:
      The result of calling the lookup function for index, possibly from cache
    • clear

      void clear()
      Release all resources held by the cache.
    • createPlaceholder

      static <VALUE_TYPE> VALUE_TYPE createPlaceholder​(@NotNull Class<VALUE_TYPE> valueType)
      Attempt to instantiate an instance of valueType with the nullary constructor, in order to create a placeholder instance reference.
      Parameters:
      valueType - The type of the desired placeholder
      Returns:
      A placeholder instance reference