常用的函数接口
2016-05-21 08:06
741 查看
常用的函数接口:
输入T类型,没有返回值
@FunctionalInterface public interface Function<T, R> { /** * Applies this function to the given argument. * * @param t the function argument * @return the function result */ R apply(T t); }输入参数T,转换为目标类型R
@FunctionalInterface public interface Predicate<T> { /** * Evaluates this predicate on the given argument. * * @param t the input argument * @return {@code true} if the input argument matches the predicate, * otherwise {@code false} */ boolean test(T t); }输入参数T,返回boolean值,做判断使用
@FunctionalInterface public interface Supplier<T> { /** * Gets a result. * * @return a result */ T get(); }没有输入,返回T类型数据
@FunctionalInterface public interface Consumer<T> { /** * Performs this operation on the given argument. * * @param t the input argument */ void accept(T t); }
输入T类型,没有返回值
相关文章推荐
- C#函数式编程中的缓存技术详解
- C#函数式编程中的部分应用详解
- 浅谈javascript函数式编程
- 使用 JavaScript 进行函数式编程 (一) 翻译
- C#函数式编程中的标准高阶函数详解
- 深入探讨javascript函数式编程
- Java函数式编程(五):闭包
- javascript 函数式编程
- 用函数式编程技术编写优美的 JavaScript_ibm
- C#函数式编程中的递归调用之尾递归详解
- Javascript函数式编程语言
- C#函数式编程中的惰性求值详解
- Java8 CompletableFuture详解
- Spring 4 支持的 Java 8 特性
- javascript函数式编程程序员的工具集
- Javascript函数式编程简单介绍
- 《JavaScript函数式编程》读后感
- 在Linux操作系统上安装和更新JAVA8的教程
- Java8 HashMap的实现原理分析
- Java函数式编程(十二):监控文件修改