public int add ( T item ) { Integer count = map . get ( item ) ; if ( count == null ) { map . put ( item , 1 ) ; return 1 ; } else { map . put ( item , count + 1 ) ; return count + 1 ; } }
add item to histogram increasing its frequency by one