Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tripi.asp.util
Class CacheMap  view CacheMap download CacheMap.java

java.lang.Object
  extended bycom.tripi.asp.util.CacheMap

public class CacheMap
extends java.lang.Object

This class implements a "cache" for storing a fixed maximum number of objects.

Version:
0.9

Field Summary
(package private)  java.util.Vector activeValues
          A queue of the active values in this map
(package private)  java.util.WeakHashMap allValues
          This is a WeakHashMap reference to all of the values in this map.
(package private)  java.util.Hashtable exists
          A hashtable for existance test
(package private)  int maxValues
          The maximum number of values to hold
 
Constructor Summary
CacheMap(int maxValues)
          Constructor
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          Obtain a value in the hash
 void put(java.lang.Object key, java.lang.Object value)
          Put a key in the hash
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allValues

java.util.WeakHashMap allValues
This is a WeakHashMap reference to all of the values in this map.


maxValues

int maxValues
The maximum number of values to hold


activeValues

java.util.Vector activeValues
A queue of the active values in this map


exists

java.util.Hashtable exists
A hashtable for existance test

Constructor Detail

CacheMap

public CacheMap(int maxValues)
Constructor

Method Detail

get

public java.lang.Object get(java.lang.Object key)
Obtain a value in the hash


put

public void put(java.lang.Object key,
                java.lang.Object value)
Put a key in the hash