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 TypeMethodDescriptionvoidclear()Release all resources held by the cache.static <VALUE_TYPE>
VALUE_TYPEcreatePlaceholder(Class<VALUE_TYPE> valueType) Attempt to instantiate an instance of valueType with the nullary constructor, in order to create a placeholder instance reference.get(long index, EXTRA_INPUT_TYPE extra) Lookup the value for index.
-
Method Details
-
get
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
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
-