|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Base interface for the DynamicCounter
and the
StaticCounter
, specifing all operations to
retrieve information about the results of a counter.
A counter represents an object, which contains a set of so called
counting rules and key/value pairs containing the result
of the counting process. The user has the ability to
pass objects via passThrough(...)
to the counter, which takes all elements and overhands
them to its internal safed rules. Rules can be true
or false
for an object. Every time a rule becomes
true for an object, the counter will increase a numerical value
of an specific key/value pair. The association between a rules
and a key/value pair is implementation specific.
Please read the small introduction to the counters of this package can be found in the user guide.
Method Summary | |
int |
getResultFor(java.lang.Object pKey)
Gets a specific result from a counting result key/value pair of the counter. |
java.util.Iterator |
getResultKeys()
Returns a iteration with all keys of all currently known key/value pairs. |
boolean |
hasResultFor(java.lang.Object pKey)
Method to check if the counter has specific counting result key/value pair or not. |
void |
passThrough(java.util.Iterator pIterator)
Overhands all elements of a given iteration to all internal counting rules. |
void |
passThrough(java.lang.Object pVictim)
Overhands a given object to all internal counting rules. |
void |
reset()
Discards all results collected by this counter instance and brings it back to creation state. |
Method Detail |
public void passThrough(java.lang.Object pVictim)
pVictim
- an Object
instance representing
the element to pass to the internal rules. Can be
null
.public void passThrough(java.util.Iterator pIterator)
pIterator
- an Iterator
object pointing
to all elements to pass to the internal rules.public boolean hasResultFor(java.lang.Object pKey)
pKey
- an Object
object representing the
key of the key/value pair those existence has to be checked.
boolean
value which is true
if a pair with this key exists.public int getResultFor(java.lang.Object pKey) throws java.util.NoSuchElementException
pKey
- an Object
object, representing the
key of the key/value pair, those value should be returned.
int
value representing the counting
result for the given key.
java.util.NoSuchElementException
- if the key/value
couldn't be found.public java.util.Iterator getResultKeys()
Iterator
object pointing to all
currently known key objects.public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |