BigSegmentedArray baseCounts = _baseCollector.getCountDistribution();
if (_start instanceof Long) {
long start = _start.longValue();
long unit = _unit.longValue();
TermLongList valArray = (TermLongList) _valArray;
for (int i = startIdx; i < endIdx; i++) {
long val = valArray.getPrimitiveValue(i);
int idx = (int) ((val - start) / unit);
if (idx >= 0 && idx < _count.size()) {
_count.add(idx, _count.get(idx) + baseCounts.get(i));
}
}
} else if (_start instanceof Integer) {
int start = _start.intValue();
int unit = _unit.intValue();
TermIntList valArray = (TermIntList) _valArray;
for (int i = startIdx; i < endIdx; i++) {
int val = valArray.getPrimitiveValue(i);
int idx = ((val - start) / unit);
if (idx >= 0 && idx < _count.size()) {
_count.add(idx, _count.get(idx) + baseCounts.get(i));
}
}