Expresso 5-6

com.jcorporate.expresso.core.dbobj
Class CacheStatEntry

java.lang.Object
  extended bycom.jcorporate.expresso.core.dbobj.CacheStatEntry
All Implemented Interfaces:
Comparable

public class CacheStatEntry
extends Object
implements Comparable

Cache Statistic Entry. Used by the DBObject system for tracking cache hit statistics

Version:
1.0

Constructor Summary
CacheStatEntry(String newName, String newDBName)
          Creates new CacheStatEntry
 
Method Summary
 int compareTo(Object o)
          Compares this object with the specified object for order.
 int getCacheHits()
          Retrieve the number of cache hits
 int getCacheMisses()
          Retrieve the number of cache misses
 String getDataContext()
          Retrieve the data context of the stat entry
 String getDBObjName()
          Retrieve the classname of the DBObject for this cache stat
 int getReadCount()
          Retrieve the overall read count for dbobjects
 void incCounts(boolean cached)
          Increment the counts for the particular class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheStatEntry

public CacheStatEntry(String newName,
                      String newDBName)
Creates new CacheStatEntry

Parameters:
newName - the new dbobject name
newDBName - the data context for the name
Method Detail

getReadCount

public int getReadCount()
Retrieve the overall read count for dbobjects

Returns:
integer

getCacheHits

public int getCacheHits()
Retrieve the number of cache hits

Returns:
integer

getCacheMisses

public int getCacheMisses()
Retrieve the number of cache misses

Returns:
integer

getDataContext

public String getDataContext()
Retrieve the data context of the stat entry

Returns:
java.lang.String

getDBObjName

public String getDBObjName()
Retrieve the classname of the DBObject for this cache stat

Returns:
java.lang.String

incCounts

public void incCounts(boolean cached)
Increment the counts for the particular class name. Increments the read count and either the cache hit or cache miss

Parameters:
cached - true if we got a cache hit, false if we got a cache miss

compareTo

public int compareTo(Object o)
Compares this object with the specified object for order.

order by hit rate, hits/misses

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.