Class SoftArrayBackedOffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>

java.lang.Object
com.illumon.util.datastructures.cache.BaseOffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>
com.illumon.util.datastructures.cache.SoftArrayBackedOffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>
All Implemented Interfaces:
OffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>

public class SoftArrayBackedOffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>
extends BaseOffsetLookupCache<VALUE_TYPE,​EXTRA_INPUT_TYPE>
Caching data structure for caching int (offset) to Object mappings. For use when lookup is expensive but idempotent, and the range of offset indexes is relatively contiguous. This is only suitable for lookup functions that return fully-initialized, immutable objects (or null).

This implementation stores data in an array of softly-reachable arrays, to enable unused regions to be reclaimed under memory pressure.