net.ontopia.topicmaps.impl.utils
Class StatisticsIndex<K,V>

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.StatisticsIndex<K,V>
All Implemented Interfaces:
LookupIndexIF<K,V>

public class StatisticsIndex<K,V>
extends java.lang.Object
implements LookupIndexIF<K,V>

INTERNAL: A lookup index that transforms its entry values to and from SoftReferences. Storage of the actual value is delegated to the nested index.


Field Summary
protected  int hits
           
protected  LookupIndexIF<K,java.lang.ref.Reference<V>> index
           
protected  int misses
           
protected  int misses_deref
           
protected  java.lang.String name
           
protected  int total
           
 
Constructor Summary
StatisticsIndex(java.lang.String name, LookupIndexIF<K,java.lang.ref.Reference<V>> index)
           
 
Method Summary
 void dump()
           
 V get(K key)
           
protected  int percent(int c, int total)
           
 V put(K key, V value)
           
 V remove(K key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

total

protected int total

hits

protected int hits

misses

protected int misses

misses_deref

protected int misses_deref

name

protected java.lang.String name

index

protected LookupIndexIF<K,java.lang.ref.Reference<V>> index
Constructor Detail

StatisticsIndex

public StatisticsIndex(java.lang.String name,
                       LookupIndexIF<K,java.lang.ref.Reference<V>> index)
Method Detail

get

public V get(K key)
Specified by:
get in interface LookupIndexIF<K,V>

put

public V put(K key,
             V value)
Specified by:
put in interface LookupIndexIF<K,V>

remove

public V remove(K key)
Specified by:
remove in interface LookupIndexIF<K,V>

percent

protected int percent(int c,
                      int total)

dump

public void dump()


Copyright © 2000-2012 Ontopia.