Called by the getCount(Symbol)
method.
Called by the getCount(Symbol)
method.
The getCount
method takes care of the synchronization.
Called by the updateCount(Symbol, Int)
method.
Called by the updateCount(Symbol, Int)
method.
The updateCount
method takes care of the synchronization.
Returns the overall count
that has been summed up with the given symbol s
.
Resets the overall count of the given symbol.
Resets everything.
Resets everything. The effect is comparable to creating a new instance, but is more efficient.
Updates the count related to the entity identified by the given symbol.
Updates the count related to the entity identified by the given symbol.
If the passed value
is positive the count will be increased whereas it will be
decreased when a negative number is passed.
Symbol used to correlate values related to the same entity.
The value that will be added to the entity's current value.
Acquires the read lock associated with this instance and then executes
the function f
.
Acquires the read lock associated with this instance and then executes
the function f
. Afterwards, the lock is released.
Acquires the write lock associated with this instance and then executes
the function f
.
Acquires the write lock associated with this instance and then executes
the function f
. Afterwards, the lock is released.
A simple class that enable the counting of something.
Examples:
Thread Safety
This class is thread safe.