toggle menu
Android-IMKit-SDK
5.12.0
io.rong.imkit
switch theme
search in API
Android-IMKit-SDK
/
io.rong.imkit.widget.cache
/
RongCache
Rong
Cache
public
class
RongCache
<
K
,
V
>
Modify by DragonJ on 14/11/28. Add queue for change the way of recycle.
Members
Constructors
Rong
Cache
Link copied to clipboard
public
void
RongCache
(
int maxSize
)
Functions
clear
Link copied to clipboard
public
void
clear
(
)
create
Count
Link copied to clipboard
public
final
synchronized
int
createCount
(
)
Returns the number of times
create
returned a value.
evict
All
Link copied to clipboard
public
final
void
evictAll
(
)
Clear the cache, calling
entryRemoved
on each removed entry.
eviction
Count
Link copied to clipboard
public
final
synchronized
int
evictionCount
(
)
Returns the number of values that have been evicted.
get
Link copied to clipboard
public
final
V
get
(
K
key
)
Returns the value for
key
if it exists in the cache or can be created by
#create
.
hit
Count
Link copied to clipboard
public
final
synchronized
int
hitCount
(
)
Returns the number of times
get
returned a value that was already present in the cache.
max
Size
Link copied to clipboard
public
final
synchronized
int
maxSize
(
)
For caches that do not override
sizeOf
, this returns the maximum number of entries in the cache.
miss
Count
Link copied to clipboard
public
final
synchronized
int
missCount
(
)
Returns the number of times
get
returned null or required a new value to be created.
put
Link copied to clipboard
public
final
V
put
(
K
key
,
V
value
)
Caches
value
for
key
.
put
Count
Link copied to clipboard
public
final
synchronized
int
putCount
(
)
Returns the number of times
put
was called.
remove
Link copied to clipboard
public
final
V
remove
(
K
key
)
Removes the entry for
key
if it exists.
resize
Link copied to clipboard
public
void
resize
(
int maxSize
)
Sets the size of the cache.
size
Link copied to clipboard
public
final
synchronized
int
size
(
)
For caches that do not override
sizeOf
, this returns the number of entries in the cache.
snapshot
Link copied to clipboard
public
final
synchronized
Map
<
K
,
V
>
snapshot
(
)
Returns a copy of the current contents of the cache, ordered from least recently accessed to most recently accessed.
to
String
Link copied to clipboard
public
final
synchronized
String
toString
(
)