org.onemind.commons.java.datastructure
Class MruMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.onemind.commons.java.datastructure.MruMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class MruMap
extends java.util.HashMap
implements java.util.Map

Most recently used map (implementation based on mrulist)

Version:
$Id: MruMap.java,v 1.3 2004/10/31 15:57:55 thlee Exp $ $Name: $
Author:
TiongHiang Lee (thlee@onemindsoft.org)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
MruMap()
          {@inheritDoc}
MruMap(long size, long timeout)
          Constructor
 
Method Summary
 void clear()
          
 void expire(MruList list, java.lang.Object obj)
          {@inheritDoc}
 java.lang.Object get(java.lang.Object key)
          
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          
 void putAll(java.util.Map t)
          
 java.lang.Object remove(java.lang.Object key)
          
 void truncate(MruList list, java.lang.Object obj)
          {@inheritDoc}
 
Methods inherited from class java.util.HashMap
clone, containsKey, containsValue, entrySet, isEmpty, keySet, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, size, values
 

Constructor Detail

MruMap

public MruMap()
{@inheritDoc}


MruMap

public MruMap(long size,
              long timeout)
Constructor

Parameters:
size - the limit of the map (0 for never timeout)
timeout - the timeout (0 for never expire)
Method Detail

clear

public void clear()

Specified by:
clear in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)

Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)

Specified by:
put in interface java.util.Map

putAll

public void putAll(java.util.Map t)

Specified by:
putAll in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)

Specified by:
remove in interface java.util.Map

expire

public void expire(MruList list,
                   java.lang.Object obj)
{@inheritDoc}


truncate

public void truncate(MruList list,
                     java.lang.Object obj)
{@inheritDoc}



Copyright © 2004-2006 . All Rights Reserved.