接口 Callback<P,R>

类型参数:
P - The type of the argument provided to the call method.
R - The type of the return type of the call method.
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface Callback<P,R>
The Callback interface is designed to allow for a common, reusable interface to exist for defining APIs that requires a call back in certain situations.

Callback is defined with two generic parameters: the first parameter specifies the type of the object passed in to the call method, with the second parameter specifying the return type of the method.

从以下版本开始:
JavaFX 2.0
作者:
java
  • 方法概要

    修饰符和类型
    方法
    说明
    call(P param)
    The call method is called when required, and is given a single argument of type P, with a requirement that an object of type R is returned.
  • 方法详细资料

    • call

      R call(P param)
      The call method is called when required, and is given a single argument of type P, with a requirement that an object of type R is returned.
      参数:
      param - The single argument upon which the returned value should be determined.
      返回:
      An object of type R that may be determined based on the provided parameter value.