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

Quick Search    Search Deep

org.vrspace.util
Class Cache  view Cache download Cache.java

java.lang.Object
  extended byorg.vrspace.util.Cache

public class Cache
extends java.lang.Object

Soft cache. Does not prevent cached object from being reclaimed by gc.


Nested Class Summary
private  class Cache.CacheEntry
          Extends Reference with a key
(package private)  class Cache.Cleanup
          Cleanup procedure.
 
Field Summary
(package private)  java.util.Hashtable cache
           
(package private)  java.lang.ref.ReferenceQueue queue
           
(package private)  boolean working
           
 
Constructor Summary
Cache()
           
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          Retreives an object from the cache
static void main(java.lang.String[] args)
           
 void put(java.lang.Object key, java.lang.Object value)
          Stores an object to the cache.
 void remove(java.lang.Object key)
          Removes an object from the cache
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

java.util.Hashtable cache

queue

java.lang.ref.ReferenceQueue queue

working

boolean working
Constructor Detail

Cache

public Cache()
Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object value)
Stores an object to the cache.


get

public java.lang.Object get(java.lang.Object key)
Retreives an object from the cache


remove

public void remove(java.lang.Object key)
Removes an object from the cache


size

public int size()

main

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