Package com.fasterxml.classmate.util
Class ResolvedTypeCache
- java.lang.Object
-
- com.fasterxml.classmate.util.ResolvedTypeCache
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ConcurrentTypeCache
,LRUTypeCache
public abstract class ResolvedTypeCache extends java.lang.Object implements java.io.Serializable
Simple LRU cache used for storing up to specified number of most recently accessedResolvedType
instances. Since usage pattern is such that caller needs synchronization, cache access methods are fully synchronized so that caller need not do explicit synchronization.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResolvedTypeCache()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
_addForTest(ResolvedType type)
Method only used by test code: do not use otherwise.static ResolvedTypeCache
concurrentCache(int maxEntries)
abstract ResolvedType
find(ResolvedTypeKey key)
ResolvedTypeKey
key(java.lang.Class<?> simpleType)
Helper method for constructing reusable cache keysResolvedTypeKey
key(java.lang.Class<?> simpleType, ResolvedType[] tp)
Helper method for constructing reusable cache keysstatic ResolvedTypeCache
lruCache(int maxEntries)
abstract void
put(ResolvedTypeKey key, ResolvedType type)
abstract int
size()
-
-
-
Method Detail
-
lruCache
public static ResolvedTypeCache lruCache(int maxEntries)
- Since:
- 1.4
-
concurrentCache
public static ResolvedTypeCache concurrentCache(int maxEntries)
- Since:
- 1.4
-
key
public ResolvedTypeKey key(java.lang.Class<?> simpleType)
Helper method for constructing reusable cache keys
-
key
public ResolvedTypeKey key(java.lang.Class<?> simpleType, ResolvedType[] tp)
Helper method for constructing reusable cache keys
-
find
public abstract ResolvedType find(ResolvedTypeKey key)
-
size
public abstract int size()
-
put
public abstract void put(ResolvedTypeKey key, ResolvedType type)
-
_addForTest
protected void _addForTest(ResolvedType type)
Method only used by test code: do not use otherwise.
-
-