Rakesh API

org.rakeshv.utils
Class LinkedHashMap.Statistics

java.lang.Object
  extended by org.rakeshv.utils.LinkedHashMap.Statistics
All Implemented Interfaces:
Map.Statistics
Enclosing class:
LinkedHashMap<K,V>

static class LinkedHashMap.Statistics
extends java.lang.Object
implements Map.Statistics

An implementation of LinkedHashMap.Statistics used to track cache performance.


Field Summary
private  int successfulRequests
          A variable used to keep track of the number of successful requests received by the map.
private  int totalRemoved
          A variable used to keep track of the number of entries that are removed from the map.
private  int totalRequests
          A variable used to keep track of the number of requests received by the map.
 
Constructor Summary
LinkedHashMap.Statistics()
           
 
Method Summary
 int getSuccessfulRequests()
          Returns successfulRequests.
 int getTotalRemoved()
          Returns totalRemoved.
 int getTotalRequests()
          Returns totalRequests.
 java.lang.String toString()
          Return a string representation of this object.
(package private)  void updateSuccessfulRequests()
          Increments the value of successfulRequests.
(package private)  void updateTotalRemoved()
          Increments the value of totalRemoved.
(package private)  void updateTotalRequests()
          Increments the value of totalRequests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

totalRequests

private volatile int totalRequests
A variable used to keep track of the number of requests received by the map.


successfulRequests

private volatile int successfulRequests
A variable used to keep track of the number of successful requests received by the map. This number indicates the number of times items stored in the map was successfully retrieved.


totalRemoved

private volatile int totalRemoved
A variable used to keep track of the number of entries that are removed from the map. This applies only to entries that are automatically evicted from the cache due to size limitation. Evictions triggered by client invoking the remove method is not tracked.

Constructor Detail

LinkedHashMap.Statistics

LinkedHashMap.Statistics()
Method Detail

updateTotalRequests

final void updateTotalRequests()
Increments the value of totalRequests.


updateSuccessfulRequests

final void updateSuccessfulRequests()
Increments the value of successfulRequests.


updateTotalRemoved

final void updateTotalRemoved()
Increments the value of totalRemoved.


getTotalRequests

public final int getTotalRequests()
Returns totalRequests.

Specified by:
getTotalRequests in interface Map.Statistics
Returns:
int The value/reference of/to totalRequests.

getSuccessfulRequests

public final int getSuccessfulRequests()
Returns successfulRequests.

Specified by:
getSuccessfulRequests in interface Map.Statistics
Returns:
int The value/reference of/to successfulRequests.

getTotalRemoved

public final int getTotalRemoved()
Returns totalRemoved.

Specified by:
getTotalRemoved in interface Map.Statistics
Returns:
int The value/reference of/to totalRemoved.

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
String The string representation.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan