Interface OffsetLookupCache<VALUE_TYPE,EXTRA_INPUT_TYPE>

All Known Implementing Classes:
ArrayBackedOffsetLookupCache, 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
    Release all resources held by the cache.
    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.
    get(int index, EXTRA_INPUT_TYPE extra)
    Lookup the value for index.
  • Method Details

    • get

      VALUE_TYPE get(int 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 @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