/** * Finalizes a Cross transformation by applying a {@link CrossFunction} to each pair of crossed elements.<br/> * Each CrossFunction call returns exactly one element. * * @param function The CrossFunction that is called for each pair of crossed elements. * @return An CrossOperator that represents the crossed result DataSet * * @see CrossFunction * @see DataSet */ public <R> CrossOperator<I1, I2, R> with(CrossFunction<I1, I2, R> function) { if (function == null) { throw new NullPointerException("Cross function must not be null."); } TypeInformation<R> returnType = TypeExtractor.getCrossReturnTypes(function, input1.getType(), input2.getType()); return new CrossOperator<I1, I2, R>(input1, input2, function, returnType); }