org.logicblaze.lingo.util
Interface TimeoutMap

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
DefaultTimeoutMap

public interface TimeoutMap
extends java.lang.Runnable

Represents a thread safe map of values which timeout after a period of inactivity.

Version:
$Revision$

Method Summary
 java.lang.Object get(java.lang.Object key)
          Looks up the value in the map by the given key.
 java.lang.Object[] getKeys()
          Returns a copy of the keys in the map
 void purge()
          Purges any old entries from the map
 void put(java.lang.Object key, java.lang.Object value, long timeoutMillis)
          Adds the key value pair into the map such that some time after the given timeout the entry will be evicted
 void remove(java.lang.Object key)
           
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

get

java.lang.Object get(java.lang.Object key)
Looks up the value in the map by the given key.

Parameters:
key - the key of the value to search for
Returns:
the value for the given key or null if it is not present (or has timed out)

getKeys

java.lang.Object[] getKeys()
Returns a copy of the keys in the map


put

void put(java.lang.Object key,
         java.lang.Object value,
         long timeoutMillis)
Adds the key value pair into the map such that some time after the given timeout the entry will be evicted


remove

void remove(java.lang.Object key)

purge

void purge()
Purges any old entries from the map



Copyright © 2009 LogicBlaze, Inc.. All Rights Reserved.