public void update ( final float value ) { if ( Float . isNaN ( value ) ) { return ; } if ( isEmpty ( ) ) { minValue_ = value ; maxValue_ = value ; } else { if ( value < minValue_ ) { minValue_ = value ; } if ( value > maxValue_ ) { maxValue_ = value ; } } if ( levels_ [ 0 ] == 0 ) { compressWhileUpdating ( ) ; } n_ ++ ; isLevelZeroSorted_ = false ; final int nextPos = levels_ [ 0 ] - 1 ; assert levels_ [ 0 ] >= 0 ; levels_ [ 0 ] = nextPos ; items_ [ nextPos ] = value ; }
Updates this sketch with the given data item .