public T put ( final T value ) { expungeStaleEntries ( ) ; // final int hash = value . hashCode ( ) ; int index = ( hash & 0x7FFFFFFF ) % elementData . length ; Entry < T > entry = elementData [ index ] ; while ( entry != null && ! eq ( value , entry . get ( ) ) ) { entry = entry . nextInSlot ; } if ( entry == null ) { if ( ++ elementCount > threshold ) { expandElementArray ( elementData . length ) ; index = ( hash & 0x7FFFFFFF ) % elementData . length ; } entry = createHashedEntry ( value , index ) ; return null ; } final T result = entry . get ( ) ; return result ; }
Puts the specified value in the set .