question: public int rankOf ( double value ) { int ret = 0 ; if ( ! hasCapacity ( ) ) { ret = Arrays . binarySearch ( data , value ) ; if ( ret < 0 ) { return - ret - 1 ; } else { return ret ; } } else { for ( int i = 0 ; i < next ; i ++ ) { if ( data [ i ] < value ) { ret ++ ; } } return ret ; } }
target:  Returns the ordinal rank of value among the sampled values in this buffer.