org.jgroups.util
Class AgeOutCache<K>

java.lang.Object
  extended by org.jgroups.util.AgeOutCache<K>

public class AgeOutCache<K>
extends java.lang.Object

Cache which removes its elements after a certain time

Author:
Bela Ban

Nested Class Summary
static interface AgeOutCache.Handler<K>
           
 
Constructor Summary
AgeOutCache(TimeScheduler timer, long timeout)
           
AgeOutCache(TimeScheduler timer, long timeout, AgeOutCache.Handler handler)
           
 
Method Summary
 void add(K key)
           
 void clear()
           
 boolean contains(K key)
           
 AgeOutCache.Handler getHandler()
           
 long getTimeout()
           
 void remove(K key)
           
 void removeAll(java.util.Collection<K> keys)
           
 void setHandler(AgeOutCache.Handler handler)
           
 void setTimeout(long timeout)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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:
toString in class java.lang.Object


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.