JDK 1.8 Lambda 常用方法

Interface Consumer<T>
void accept(T t) Performs this operation on the given argument.
Interface BiConsumer<T,U>
void accept(T t, U u)
Interface DoubleConsumer
void accept(double value)
Interface IntConsumer
void accept(int value)
Interface LongConsumer
void accept(long value)
Interface ObjDoubleConsumer<T>
void accept(T t, double value)
Interface ObjIntConsumer<T>
void accept(T t, int value)
Interface ObjLongConsumer<T>
void accept(T t, long value)
--------------------------------------------------------------------------------------
Interface Function<T,R>
R apply(T t) Applies this function to the given argument.
Interface BiFunction<T,U,R>
R apply(T t, U u)
Interface DoubleFunction<R>
R apply(double value)
Interface IntFunction<R>
R apply(int value)
Interface LongFunction<R>
R apply(long value)
Interface ToDoubleBiFunction<T,U>
double applyAsDouble(T t, U u) 
Interface ToDoubleFunction<T>
double applyAsDouble(T value
Interface ToIntBiFunction<T,U>
int applyAsInt(T t, U u) 
Interface ToIntFunction<T>
int applyAsInt(T value)
Interface ToLongBiFunction<T,U>
long applyAsLong(T t, U u) 
Interface ToLongFunction<T>
long applyAsLong(T value)
Interface DoubleToIntFunction
int applyAsInt(double value) 
Interface DoubleToLongFunction
long applyAsLong(double value)
Interface IntToLongFunction
long applyAsLong(int value) 
Interface LongToDoubleFunction
double applyAsDouble(long value) 
Interface LongToIntFunction
int applyAsInt(long value)
Interface IntToDoubleFunction
double applyAsDouble(int value) 
----------------------------------------------------------------------------------------
Interface Predicate<T>
boolean test(T t) Evaluates this predicate on the given argument.
Interface BiPredicate<T,U>
boolean test(T t, U u)
Interface IntPredicate
boolean test(int value) 
Interface DoublePredicate
boolean test(double value) 
Interface LongPredicate
boolean test(long value)
-----------------------------------------------------------------------------------------
Interface Supplier<T>
T get() Gets a result.
Interface DoubleSupplier
double getAsDouble()
Interface IntSupplier
int getAsInt()
Interface LongSupplier
long getAsLong()
Interface BooleanSupplier
boolean getAsBoolean()
------------------------------------------------------------------------------------------
Interface UnaryOperator<T>
static <T> UnaryOperator<T> identity() Returns a unary operator that always returns its input argument.
Interface BinaryOperator<T>
static <T> BinaryOperator<T> maxBy(Comparator<? super T> comparator) 
Returns a BinaryOperator which returns the greater of two elements according to the specified Comparator.
static <T> BinaryOperator<T> minBy(Comparator<? super T> comparator) 
Returns a BinaryOperator which returns the lesser of two elements according to the specified Comparator.
Interface DoubleBinaryOperator
double applyAsDouble(double left, double right) Applies this operator to the given operands.
Interface DoubleUnaryOperator
double applyAsDouble(double operand)
Interface IntBinaryOperator
int applyAsInt(int left, int right)
Interface IntUnaryOperator
int applyAsInt(int operand) 
Interface LongBinaryOperator
long applyAsLong(long left, long right)
Interface LongUnaryOperator
long applyAsLong(long operand) 

















  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值