K
- key typeV
- value typepublic final class CacheTable<K,V> extends CacheTableTemplate<V>
MemoryHandler.Cost
cost, count, data, description, estEmptyCount, INITIAL_CAPACITY, memoryMangerThreshold, PROPERTY_ENABLE_POINTER_CHECK, rwLock, unallocated
Constructor and Description |
---|
CacheTable(java.lang.String description)
Creates a new cache table
|
CacheTable(java.lang.String description,
MemoryHandler.Cost cost)
creates a new cache table
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(K key)
Returns true if this map contains a mapping for the specified
key.
|
protected InterfaceEntry[] |
createArray(int size)
create a new array
|
V |
find(K key)
a short hand method for getting an object and if that object is a
NotFoundException re-throwing the exception.
|
V |
get(K key)
Retrieve the data for the key.
|
V |
put(K key,
V orginal)
Puts data into the cache table.
|
V |
remove(K key)
Removes the mapping for this key from this map if present.
|
checkRegister, clear, compact, containsValue, freeMemory, getAverageSize, getCost, getDescription, getEstimatedSize, getHardLinkCount, getLastAccessed, isEmpty, panicFreeMemory, queuedFreeMemory, rehash, removeElement, setAverageSize, setMayReleaseReferences, setThreshold, size, stats, tidyUp, tidyUpRequired, toString, touch
public CacheTable(@Nonnull java.lang.String description)
description
- The description of this cache table.public CacheTable(@Nonnull java.lang.String description, @Nonnull MemoryHandler.Cost cost)
description
- the description of this cache tablecost
- The relative cost of this cache table.@CheckReturnValue public boolean containsKey(@Nonnull K key)
key
- key whose presence in this Map is to be tested.@Nullable public V remove(@Nonnull K key)
key
- key whose mapping is to be removed from the map.@CheckReturnValue @Nullable public V get(@Nonnull K key)
key
- The key to get.@Nullable @CheckReturnValue public V find(@Nonnull K key) throws java.lang.Exception
key
- The key to find.java.lang.Exception
- Not Found if the object is known not to exist.@Nullable public V put(@Nonnull K key, @Nullable V orginal)
orginal
- The object to put into the table.key
- The key to be used.@CheckReturnValue @Nonnull protected InterfaceEntry[] createArray(int size)
createArray
in class CacheTableTemplate<V>
size
- the new size of the arraystSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.