V newValue = remappingFunction.apply(key, oldValue); if (newValue != null) { if (oldValue != null) {
V newValue = remappingFunction.apply(key, oldValue); if (newValue != null) { if (oldValue != null) {
Objects.requireNonNull(remappingFunction); for (V oldValue; (oldValue = map.get(key)) != null; ) { V newValue = remappingFunction.apply(key, oldValue); if ((newValue == null) ? map.remove(key, oldValue)
Objects.requireNonNull(remappingFunction); for (V oldValue; (oldValue = map.get(key)) != null; ) { V newValue = remappingFunction.apply(key, oldValue); if ((newValue == null) ? map.remove(key, oldValue)
V newValue = remappingFunction.apply(oldValue, value); if (newValue != null) { if (map.replace(key, oldValue, newValue))
V newValue = remappingFunction.apply(oldValue, value); if (newValue != null) { if (map.replace(key, oldValue, newValue))
Objects.requireNonNull(function); forEach(map, (k,v) -> { while (!map.replace(k, v, function.apply(k, v))) {
/** * Returns a composed function that first applies the {@code this_} function to * its inputs, and then applies the {@code after} function to the result. * If evaluation of either function throws an exception, it is relayed to * the caller of the composed function. * * @param <R> the type of the result of the {@code this_} function and the type of the input of the {@code after} function. * @param <T> the type of the first argument to the {@code this_} function * @param <U> the type of the second argument to the {@code this_} function * @param <V> the type of output of the {@code after} function, and of the * composed function * @param this_ the {@code BiFunction} to be applied first. * @param after the function to apply after the {@code this_} function is applied * @return a composed function that first applies the {@code this_} function and then * applies the {@code after} function * @throws NullPointerException if {@code this_} is null * @throws NullPointerException if after is null */ public static <R, T, U, V> BiFunction<T, U, V> andThen(BiFunction<? super T, ? super U, ? extends R> this_, Function<? super R, ? extends V> after) { Objects.requireNonNull(this_); Objects.requireNonNull(after); return (T t, U u) -> after.apply(this_.apply(t, u)); }
Objects.requireNonNull(function); forEach(map, (k,v) -> { while (!map.replace(k, v, function.apply(k, v))) {
V newValue = remappingFunction.apply(key, oldValue); if (newValue == null) {
V newValue = remappingFunction.apply(key, oldValue); if (newValue == null) {
V newValue = remappingFunction.apply(key, oldValue); if (newValue != null) { map.put(key, newValue);
/** * Returns a composed function that first applies the {@code this_} function to * its inputs, and then applies the {@code after} function to the result. * If evaluation of either function throws an exception, it is relayed to * the caller of the composed function. * * @param <R> the type of the result of the {@code this_} function and the type of the input of the {@code after} function. * @param <T> the type of the first argument to the {@code this_} function * @param <U> the type of the second argument to the {@code this_} function * @param <V> the type of output of the {@code after} function, and of the * composed function * @param this_ the {@code BiFunction} to be applied first. * @param after the function to apply after the {@code this_} function is applied * @return a composed function that first applies the {@code this_} function and then * applies the {@code after} function * @throws NullPointerException if {@code this_} is null * @throws NullPointerException if after is null */ public static <R, T, U, V> BiFunction<T, U, V> andThen(BiFunction<? super T, ? super U, ? extends R> this_, Function<? super R, ? extends V> after) { Objects.requireNonNull(this_); Objects.requireNonNull(after); return (T t, U u) -> after.apply(this_.apply(t, u)); }
final <S> boolean uniHandle(Object r, BiFunction<? super S, Throwable, ? extends T> f, UniHandle<S, T> c) { S s; Throwable x; if (result == null) { try { if (c != null && !c.claim()) return false; if (r instanceof AltResult) { x = ((AltResult) r).ex; s = null; } else { x = null; @SuppressWarnings("unchecked") S ss = (S) r; s = ss; } completeValue(f.apply(s, x)); } catch (Throwable ex) { completeThrowable(ex); } } return true; }
V newValue = remappingFunction.apply(key, oldValue); if (newValue != null) { map.put(key, newValue);
v = function.apply(k, v);
v = function.apply(k, v);
remappingFunction.apply(oldValue, value); if (newValue == null) { map.remove(key);
remappingFunction.apply(oldValue, value); if (newValue == null) { map.remove(key);
@SuppressWarnings("unchecked") S ss = (S) s; completeValue(f.apply(rr, ss)); } catch (Throwable ex) { completeThrowable(ex);