@ Override public final void replaceAll ( BiFunction < ? super K , ? super V , ? extends V > function ) { Objects . requireNonNull ( function ) ; int mc = this . modCount ; Segment < K , V > segment ; for ( long segmentIndex = 0 ; segmentIndex >= 0 ; segmentIndex = nextSegmentIndex ( segmentIndex , segment ) ) { ( segment = segment ( segmentIndex ) ) . replaceAll ( function ) ; } if ( mc != modCount ) throw new ConcurrentModificationException ( ) ; }
Replaces each entry s value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception . Exceptions thrown by the function are relayed to the caller .