语言

SparseBooleanArray.Compute(Int32, IIntBinaryOperator) 方法

定义

尝试根据指定键的当前映射值计算新的映射值(如果没有当前映射,则为 false)。

[Android.Runtime.Register("compute", "(ILjava/util/function/IntBinaryOperator;)Z", "GetCompute_ILjava_util_function_IntBinaryOperator_Handler", ApiSince=37)]
public virtual bool Compute(int key, Java.Util.Functions.IIntBinaryOperator function);
[<Android.Runtime.Register("compute", "(ILjava/util/function/IntBinaryOperator;)Z", "GetCompute_ILjava_util_function_IntBinaryOperator_Handler", ApiSince=37)>]
abstract member Compute : int * Java.Util.Functions.IIntBinaryOperator -> bool
override this.Compute : int * Java.Util.Functions.IIntBinaryOperator -> bool

参数

key
Int32

要计算其值的键。

function
IIntBinaryOperator

用于计算新值的函数。 对于表示当前映射值的第二个参数,0 用于 false 和 1 表示 true。 返回的值将转换为布尔值,如果值为 false,则为 0;否则为 true。

返回

新的映射值。

属性

注解

尝试根据指定键的当前映射值计算新的映射值(如果没有当前映射,则为 false)。 传递给函数并从中返回的布尔值将转换为整数(0 表示 false,否则为 true),以避免类型装箱。

Android 参考。android.util.SparseBooleanArray.compute

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于