org.xshare.base.counter
Interface StaticCounter

All Superinterfaces:
BaseCounter

public interface StaticCounter
extends BaseCounter

Configurable counter with a one-2-one relation between a counting rule and a result key/value pair.

Notes On The Implementation

  1. Calling BaseCounter.reset() will set the values of all currently known result key/value pairs to 0. The key/value pairs will still exist.

Version:
$Revision: 1.3 $
Author:
Oliver Fischer
See Also:
Introduction to counters in the User guide, DynamicCounter

Method Summary
 void addRule(java.lang.Object pKey, UnaryPredicate pRule)
          Installs a new rule expressed as UnaryPredicate together with the key for the associated key/value pair.
 
Methods inherited from interface org.xshare.base.counter.BaseCounter
getResultFor, getResultKeys, hasResultFor, passThrough, passThrough, reset
 

Method Detail

addRule

public void addRule(java.lang.Object pKey,
                    UnaryPredicate pRule)
Installs a new rule expressed as UnaryPredicate together with the key for the associated key/value pair.

A counting rule installed via this method will - when becoming true - increase only the value of the key/value pair with the same key as given as parameter to this method.

Parameters:
pKey - an Object object specifing the key of the key/value pair to associate with the rule.
pRule - an UnaryPredicate object representing the rule to install.
Throws:
java.lang.NullPointerException - if key or rule are null.
ResultTupleAlreadyInstalledException - if the specified key is already in use.


jKiska Base 0.2.1 Release Esche [http://jkiska.sourceforge.net]