Package com.strobel.collections
Class ThreadLocalIdentityCache<K,V>
java.lang.Object
com.strobel.collections.Cache<K,V>
com.strobel.collections.ThreadLocalIdentityCache<K,V>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPlaces a value in the cache only if no value exists with the same key.Gets the value associated with the given key.Returns a thread-specific satellite cache chained to this cache.boolean
Replaces the value associated with a given key if the current value matches the expected value.Methods inherited from class com.strobel.collections.Cache
contains, contains, createSatelliteCache, createSatelliteCache, createSatelliteIdentityCache, createSatelliteIdentityCache, createThreadLocalCache, createThreadLocalCache, createThreadLocalIdentityCache, createThreadLocalIdentityCache, createTopLevelCache
-
Field Details
-
_parent
-
_threadCaches
-
-
Constructor Details
-
ThreadLocalIdentityCache
public ThreadLocalIdentityCache() -
ThreadLocalIdentityCache
-
-
Method Details
-
getSatelliteCache
Description copied from class:Cache
Returns a thread-specific satellite cache chained to this cache. If the target cache is already a satellite cache, it will simply return itself. Note that the returned cache is completely unsynchronized and is not safe for concurrent access.- Specified by:
getSatelliteCache
in classCache<K,
V> - Returns:
- A thread-specific satellite cache.
-
replace
Description copied from class:Cache
Replaces the value associated with a given key if the current value matches the expected value.
Note that the replaced value will not be propagated to child caches that already have a value for the same key. As such, this method is of limited usefulness and should only be called on isolated Level 1 caches.
-
cache
Description copied from class:Cache
Places a value in the cache only if no value exists with the same key. -
get
Description copied from class:Cache
Gets the value associated with the given key.
-