xxl.mathematica.list.Table Maven / Gradle / Ivy
package xxl.mathematica.list;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;
/**
* 表格
*/
public class Table {
/**
* 根据离散点来生成表
*
* @param function
* @param list
* @param
* @param
* @return
*/
public static List table(Function function, List list) {
return io.vavr.collection.List.ofAll(list)
.map(function)
.asJava();
}
/**
* 根据离散点列表来生成二维表
*
* @param function
* @param list1
* @param list2
* @param
* @param
* @return
*/
public static List> table(BiFunction function, List list1, List list2) {
return io.vavr.collection.List.ofAll(list1)
.map(t1 -> io.vavr.collection.List.ofAll(list2)
.map(t2 -> function.apply(t1, t2))
.asJava())
.asJava();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy