Package org.jgroups.util
Class AgeOutCache<K>
- java.lang.Object
-
- org.jgroups.util.AgeOutCache<K>
-
public class AgeOutCache<K> extends java.lang.ObjectCache which removes its elements after a certain time- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAgeOutCache.Handler<K>
-
Constructor Summary
Constructors Constructor Description AgeOutCache(TimeScheduler timer, long timeout)AgeOutCache(TimeScheduler timer, long timeout, AgeOutCache.Handler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(K key)voidclear()booleancontains(K key)AgeOutCache.HandlergetHandler()longgetTimeout()voidremove(K key)voidremoveAll(java.util.Collection<K> keys)voidsetHandler(AgeOutCache.Handler handler)voidsetTimeout(long timeout)intsize()java.lang.StringtoString()
-
-
-
Constructor Detail
-
AgeOutCache
public AgeOutCache(TimeScheduler timer, long timeout)
-
AgeOutCache
public AgeOutCache(TimeScheduler timer, long timeout, AgeOutCache.Handler handler)
-
-
Method Detail
-
getTimeout
public long getTimeout()
-
setTimeout
public void setTimeout(long timeout)
-
getHandler
public AgeOutCache.Handler getHandler()
-
setHandler
public void setHandler(AgeOutCache.Handler handler)
-
add
public void add(K key)
-
contains
public boolean contains(K key)
-
remove
public void remove(K key)
-
removeAll
public void removeAll(java.util.Collection<K> keys)
-
clear
public void clear()
-
size
public int size()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-