Package org.cache2k.core
Class IntHeapCache<V>
- java.lang.Object
-
- org.cache2k.core.BaseCache<K,V>
-
- org.cache2k.core.HeapCache<Integer,V>
-
- org.cache2k.core.IntHeapCache<V>
-
- All Implemented Interfaces:
AutoCloseable,org.cache2k.Cache<Integer,V>,InternalCache<Integer,V>,InternalCacheCloseContext,HeapCacheForEviction<Integer,V>,TimerEventListener<Integer,V>,org.cache2k.DataAware<Integer,V>,org.cache2k.KeyValueSource<Integer,V>
public class IntHeapCache<V> extends HeapCache<Integer,V>
Overwrite methods so the integer value gets stored directly in theEntry.hashCodefield andEntry.valueis set to null.- Author:
- Jens Wilke
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cache2k.core.HeapCache
HeapCache.Tunable
-
-
Field Summary
-
Fields inherited from class org.cache2k.core.HeapCache
clearCnt, clearedTime, clearRemovedCnt, clock, DEFAULT_EXCEPTION_PROPAGATOR, exceptionPropagator, hash, internalExceptionCnt, keyMutationCnt, keyType, loader, lock, manager, name, startedTime, timing, TUNABLE, valueType
-
-
Constructor Summary
Constructors Constructor Description IntHeapCache(InternalCacheBuildContext<Integer,V> ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Hash2<Integer,V>createHashTable()Modified hash table implementation.IntegerkeyObjFromEntry(Entry<Integer,V> e)Either returns the stored key object or the integer object created from the hashCode field.intspreadedHashFromEntry(Entry e)IntegertoEntryKey(Integer key)The key object or null, for integer keyed cachesinttoStoredHashCodeOrKey(Integer key, int hc)We store either the spreaded hash code or the raw integer key in the hash table-
Methods inherited from class org.cache2k.core.HeapCache
cancelTimerJobs, checkAllPresent, checkClosed, checkIntegrity, clear, clearLocalCache, close, closePart1, closePart2, computeIfAbsent, containsAndRemove, containsKey, convertCacheEntry2ValueMap, convertValueMap, createEntryAction, createFireAndForgetAction, executeLoader, executeWithGlobalLock, expireEntry, finishLoadOrEviction, generateKeySet, get, getAll, getCacheManager, getClock, getCommonMetrics, getConsistentInfo, getConsistentInfo, getEntry, getEntryInternal, getEntryInternal, getEntryState, getEviction, getExecutor, getHashEntries, getInfo, getInfo, getIntegrityState, getKeyType, getLoaderExecutor, getLog, getName, getRefreshExecutor, getTiming, getTotalEntryCount, getValueType, init, initWithoutTimerHandler, insert, insertNewEntry, insertOrUpdateAndCalculateExpiry, invoke, isClosed, isKeepAfterExpired, isLoaderPresent, isNullValuePermitted, isRecordRefreshTime, isRefreshAhead, isRejectNullValues, isUpdateTimeNeeded, isWeigherPresent, iterateAllHeapEntries, iterator, load, loadAll, loadAndReplace, logAndCountInternalException, lookupEntry, lookupEntry, lookupEntryNoHitRecord, lookupEntryNoHitRecord, lookupOrNewEntry, lookupOrNewEntry, lookupOrNewEntryNoHitRecord, peek, peekAll, peekAndPut, peekAndRemove, peekAndReplace, peekEntry, peekEntryInternal, peekEntryInternal, put, putAll, putIfAbsent, putValue, recordHit, reloadAll, remove, removeEntry, removeEntryForEviction, removeIfEquals, replace, replace, replaceIfEquals, returnCacheEntry, returnCacheEntry, returnEntry, returnNullValueDetectedException, returnValue, returnValue, setTiming, spreadHash, startRefreshProbationTimer, timerEventExpireEntry, timerEventProbationTerminated, timerEventRefresh
-
Methods inherited from class org.cache2k.core.BaseCache
asMap, closeCustomization, entries, execute, execute, expireAt, getQualifiedName, invokeAll, keys, removeAll, removeAll, requestInterface, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cache2k.core.api.InternalCache
getUserCache
-
-
-
-
Constructor Detail
-
IntHeapCache
public IntHeapCache(InternalCacheBuildContext<Integer,V> ctx)
-
-
Method Detail
-
toEntryKey
public Integer toEntryKey(Integer key)
Description copied from class:HeapCacheThe key object or null, for integer keyed caches- Overrides:
toEntryKeyin classHeapCache<Integer,V>
-
toStoredHashCodeOrKey
public int toStoredHashCodeOrKey(Integer key, int hc)
Description copied from class:HeapCacheWe store either the spreaded hash code or the raw integer key in the hash table- Overrides:
toStoredHashCodeOrKeyin classHeapCache<Integer,V>
-
spreadedHashFromEntry
public int spreadedHashFromEntry(Entry e)
- Overrides:
spreadedHashFromEntryin classHeapCache<Integer,V>
-
keyObjFromEntry
public Integer keyObjFromEntry(Entry<Integer,V> e)
Description copied from class:HeapCacheEither returns the stored key object or the integer object created from the hashCode field.- Overrides:
keyObjFromEntryin classHeapCache<Integer,V>
-
-