public class LFUCache<K,V> extends Object
| 构造器和说明 |
|---|
LFUCache() |
LFUCache(int maxCapacity,
float evictionFactor)
Constructs and initializes cache with specified capacity and eviction
factor.
|
LFUCache(int maxCapacity,
float evictionFactor,
long removeFreqEntryTimeout)
Constructs and initializes cache with specified capacity and eviction
factor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
V |
get(K key) |
int |
getCapacity() |
Long |
getFreq(K key)
Returns freq of the element
|
int |
getFreqListSize(Long freq)
Returns node list's size of this frequency
|
int |
getFreqTableSize()
Returns size of the freq table
|
int |
getSize()
Returns cache current size.
|
V |
put(K key,
V value) |
V |
remove(K key) |
public LFUCache()
public LFUCache(int maxCapacity,
float evictionFactor)
IllegalArgumentException.maxCapacity - cache max capacityevictionFactor - cache proceedEviction factorpublic LFUCache(int maxCapacity,
float evictionFactor,
long removeFreqEntryTimeout)
IllegalArgumentException.maxCapacity - cache max capacityevictionFactor - cache proceedEviction factorremoveFreqEntryTimeout - cache queue remove timeoutpublic int getCapacity()
public int getFreqTableSize()
public int getFreqListSize(Long freq)
public int getSize()
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.