toolbox
Class Cache

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bytoolbox.ConvenientHashtable
              extended bytoolbox.Cache
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Cache
extends ConvenientHashtable

A hashtable caching up to maxCapacity amount of arbitrary objects. If size>maxCapacity, old entries are deleted using FIFO.

Author:
ottlik
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
(package private)  java.util.Vector insertionOrder
           
(package private)  int maxCapacity
           
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
Cache()
           
Cache(int mC)
           
 
Method Summary
 java.lang.Object put(int key, java.lang.Object value)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void setMaxCapacity(int _maxCapacity)
           
 
Methods inherited from class toolbox.ConvenientHashtable
containsKey, containsKey, containsValue, containsValue, get, get, put, remove, remove
 
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

maxCapacity

int maxCapacity

insertionOrder

java.util.Vector insertionOrder
Constructor Detail

Cache

public Cache()

Cache

public Cache(int mC)
Method Detail

setMaxCapacity

public void setMaxCapacity(int _maxCapacity)

put

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

put

public java.lang.Object put(int key,
                            java.lang.Object value)
Overrides:
put in class ConvenientHashtable