com.alachisoft.ncache.common.caching.statistics.customcounters.NumberOfItemCounter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-common Show documentation
Show all versions of nc-common Show documentation
Internal package of Alachisoft.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.alachisoft.ncache.common.caching.statistics.customcounters;
/**
* @author Muneeb Shahid
*/
public class NumberOfItemCounter extends PerformanceCounterBase {
public NumberOfItemCounter(String name, String instance) {
super(name, instance);
}
public NumberOfItemCounter(String category, String name, String instance) {
super(category, name, instance);
}
@Override
public void increment() {
synchronized (this) {
_value++;
}
}
@Override
public void incrementBy(double value) {
synchronized (this) {
_value += value;
}
}
@Override
public void decrement() {
synchronized (this) {
_value--;
}
}
@Override
public void decrementBy(double value) {
synchronized (this) {
_value -= value;
}
}
@Override
public double getValue() {
return _value;
}
@Override
public void setValue(double _value) {
super._value = _value;
}
}