org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > > Class Reference

This is a helper class for implementing statistics. More...

List of all members.

Classes

interface  IStatsEnum
 The statistics Enum used by "K extends Enum<K>" must implement this interface. More...

Public Member Functions

 CCNEnumStats (IStatsEnum stats)
void clearCounters ()
 Reset all counters to zero.
long getCounter (String name) throws IllegalArgumentException
 Return the value of a counter.
String[] getCounterNames ()
 Return a list of statistic counter names, in the preferred display order.
String getCounterUnits (String name) throws IllegalArgumentException
 Return a text description of the units of the counter (e.g.
void setEnabled (boolean enabled)
 If enabled, gather stats, otherwise do not.
String toString ()
 Dump the counters in the preferred format to a String for display.
void increment (K key)
void increment (K key, int value)

Protected Attributes

final AtomicLong[] _counters
final IStatsEnum _resolver
boolean _enabled = true

Detailed Description

This is a helper class for implementing statistics.


Member Function Documentation

long org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.getCounter ( String  name  )  throws IllegalArgumentException [virtual]

Return the value of a counter.

Parameters:
name 
Returns:
Exceptions:
IllegalArgumentException if name unrecognized

Implements org.ccnx.ccn.impl.CCNStats.

String [] org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.getCounterNames (  )  [virtual]

Return a list of statistic counter names, in the preferred display order.

Returns:

Implements org.ccnx.ccn.impl.CCNStats.

String org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.getCounterUnits ( String  name  )  throws IllegalArgumentException [virtual]

Return a text description of the units of the counter (e.g.

packets, packets per second)

Parameters:
name 
Returns:
Exceptions:
IllegalArgumentException if name unrecognized

Implements org.ccnx.ccn.impl.CCNStats.

void org.ccnx.ccn.impl.CCNStats.CCNEnumStats< K extends Enum< K > >.setEnabled ( boolean  enabled  )  [virtual]

If enabled, gather stats, otherwise do not.

Parameters:
enabled 

Implements org.ccnx.ccn.impl.CCNStats.


The documentation for this class was generated from the following file:
Generated on Fri May 13 16:27:37 2011 for Content-Centric Networking in Java by  doxygen 1.6.3