public void add(int item)
{
	if (capacity > 0 && item >= capacity)
		return;
	if (item < min) {
		min = item;
		countmin = 0;
	}
	if (item == min)
		countmin += 1;
	if (item > max) {
		max = item;
		countmax = 0;
	}
	if (item == max)
		countmax += 1;
	n += 1;
	sum += item;
	sqrsum += item * item;
	if (item >= 0 && item < freq.length)
		freq[item]++;
	else if (item >= 0) {
		int tmp[] = new int[item + 1];
		System.arraycopy(freq, 0, tmp, 0, freq.length);
		tmp[item]++;
		freq = tmp;
	}
}