BEA Systems, Inc.

WebLogic Server 6.0sp2 API Reference

weblogicx.jsp.tags
Class BubblingCache

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--weblogicx.jsp.tags.BubblingCache

public class BubblingCache
extends java.util.HashMap
implements java.io.Externalizable

This cache uses a simple algorithm to keep the most often used entries near the top and to recycle those entries which are not used often.

Author:
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Constructor Summary
BubblingCache()
           
BubblingCache(int size)
          Create an LRU cache of a particular maximum size.
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          When we get an object from the cache, swap its position with its neighbor, moving it up the list towards the top.
static void main(java.lang.String[] args)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          When we put an object in the cache either bubble it, if it already in the cache, or drop the bottom of the bubbler and replace it with this object.
 void readExternal(java.io.ObjectInput oi)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput oo)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BubblingCache

public BubblingCache(int size)
Create an LRU cache of a particular maximum size.

BubblingCache

public BubblingCache()
Method Detail

get

public java.lang.Object get(java.lang.Object key)
When we get an object from the cache, swap its position with its neighbor, moving it up the list towards the top.

Overrides:
get in class java.util.HashMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
When we put an object in the cache either bubble it, if it already in the cache, or drop the bottom of the bubbler and replace it with this object. If the bubbler is not full just add it to the end of the list.

Overrides:
put in class java.util.HashMap

toString

public java.lang.String toString()

Overrides:
toString in class java.util.AbstractMap

writeExternal

public void writeExternal(java.io.ObjectOutput oo)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable


readExternal

public void readExternal(java.io.ObjectInput oi)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception


Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs60