public void add ( long n ) { int index = Arrays . binarySearch ( bucketOffsets , n ) ; if ( index < 0 ) { // inexact match, take the first bucket higher than n index = - index - 1 ; } // else exact match; we're good buckets . incrementAndGet ( index ) ; }
Increments the count of the bucket closest to n rounding UP .