/** * Returns a composed operator that first applies the {@code this_} operator to its input, and * then applies the {@code after} operator to the result. If evaluation of either operator throws * an exception, it is relayed to the caller of the composed operator. * * @param this_ the operator to apply before the {@code after} operator is applied * @param after the operator to apply after the {@code this_} operator is applied * @return a composed operator that first applies the {@code this_} operator and then applies the * {@code after} operator * @throws NullPointerException if {@code this_} is null * @throws NullPointerException if after is null * @see #compose(LongUnaryOperator, LongUnaryOperator) */ public static LongUnaryOperator andThen( final LongUnaryOperator this_, final LongUnaryOperator after) { Objects.requireNonNull(this_); Objects.requireNonNull(after); return (long t) -> after.applyAsLong(this_.applyAsLong(t)); }
/** * Returns a composed operator that first applies the {@code before} operator to its input, and * then applies the {@code this_} operator to the result. If evaluation of either operator throws * an exception, it is relayed to the caller of the composed operator. * * @param this_ the operator to apply after the {@code before} operator is applied * @param before the operator to apply before the {@code this_} operator is applied * @return a composed operator that first applies the {@code before} operator and then applies the * {@code this_} operator * @throws NullPointerException if {@code this_} is null * @throws NullPointerException if before is null * @see #andThen(LongUnaryOperator, LongUnaryOperator) */ public static LongUnaryOperator compose( final LongUnaryOperator this_, final LongUnaryOperator before) { Objects.requireNonNull(this_); Objects.requireNonNull(before); return (long v) -> this_.applyAsLong(before.applyAsLong(v)); }