Perforce

com.perforce.api
Class HashDecay

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--com.perforce.api.HashDecay
All Implemented Interfaces:
Cloneable, Map, Runnable, Serializable

public final class HashDecay
extends Hashtable
implements Runnable

This hashtable build to contain objects that will decay over time. The objects stored must implement the Cacheable interface.

Version:
$Date: 2002/08/05 $ $Revision: #7 $
Author:
David Markley
See Also:
Hashtable, Cacheable, Serialized Form

Inner classes inherited from class java.util.Map
Map.Entry
 
Field Summary
static long MIN_DELAY
          The minimum delay allowed
 
Constructor Summary
HashDecay()
           
HashDecay(long delay)
           
 
Method Summary
 long getDelay()
          Returns the delay.
 Object put(Object key, Cacheable value)
           
 Object put(Object key, Object value)
           
 void run()
           
 void setDelay(long delay)
          Sets the delay, in milliseconds, before items in the hashtable are discarded.
 void start()
           
 void stop()
           
static void stopAll()
          Stops running threads for all HashDecay instances.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_DELAY

public static final long MIN_DELAY
The minimum delay allowed
Constructor Detail

HashDecay

public HashDecay()

HashDecay

public HashDecay(long delay)
Method Detail

getDelay

public long getDelay()
Returns the delay.

put

public Object put(Object key,
                  Cacheable value)

put

public Object put(Object key,
                  Object value)
Overrides:
put in class Hashtable

run

public void run()
Specified by:
run in interface Runnable

setDelay

public void setDelay(long delay)
Sets the delay, in milliseconds, before items in the hashtable are discarded.

start

public void start()

stop

public void stop()

stopAll

public static void stopAll()
Stops running threads for all HashDecay instances.

Perforce

Copyright © 2001, Perforce Software, All rights reserved.