com.dahuatech.hutool.cache.impl.WeakCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-common Show documentation
Show all versions of java-sdk-common Show documentation
Dahua ICC Open API SDK for Java
package com.dahuatech.hutool.cache.impl;
import java.util.WeakHashMap;
/**
* 弱引用缓存
* 对于一个给定的键,其映射的存在并不阻止垃圾回收器对该键的丢弃,这就使该键成为可终止的,被终止,然后被回收。
* 丢弃某个键时,其条目从映射中有效地移除。
*
* @author Looly
* @param 键
* @param 值
* @author looly
* @since 3.0.7
*/
public class WeakCache extends TimedCache {
private static final long serialVersionUID = 1L;
public WeakCache(long timeout) {
super(timeout, new WeakHashMap>());
}
}