修改翻译中的的文不对意 (#504)

* 修改翻译中的的文不对意 

修改翻译中的的文不对意

* 文不对意

原文:anyMatch(Predicate): Returns true if any element of the
stream produces true when provided to the supplied
Predicate. This will short-circuit upon the first true.


所以是取决于第一个 true
This commit is contained in:
ChelinTsien
2020-07-17 18:32:57 +08:00
committed by GitHub
parent c49d1cbf07
commit 6dac2c1392

View File

@@ -1957,8 +1957,8 @@ Lambda 表达式中的第一个参数 `fr0` 是上一次调用 `reduce()` 的结
### 匹配
- `allMatch(Predicate)` :如果流的每个元素根据提供的 **Predicate** 都返回 true 时,结果返回为 true。在第一个 false 时,则停止执行计算。
- `anyMatch(Predicate)`:如果流中的任意一个元素根据提供的 **Predicate** 返回 true 时,结果返回为 true。在第一个 false 是停止执行计算。
- `noneMatch(Predicate)`:如果流的每个元素根据提供的 **Predicate** 都返回 false 时,结果返回为 true。在第一个 true 时停止执行计算。
- `anyMatch(Predicate)`:如果流中的任意一个元素根据提供的 **Predicate** 返回 true 时,结果返回为 true。在第一个 true 时,则停止执行计算。
- `noneMatch(Predicate)`:如果流的每个元素根据提供的 **Predicate** 都返回 false 时,结果返回为 true。在第一个 true 时停止执行计算。
我们已经在 `Prime.java` 中看到了 `noneMatch()` 的示例;`allMatch()``anyMatch()` 的用法基本上是等同的。下面我们来探究一下短路行为。为了消除冗余代码,我们创建了 `show()`。首先我们必须知道如何统一地描述这三个匹配器的操作,然后再将其转换为 **Matcher** 接口。代码示例: