From 2bc320e5d6637e249d6deac480e65cad4feb6363 Mon Sep 17 00:00:00 2001 From: Rodrigo Moutinho Date: Fri, 13 Sep 2019 05:32:01 -0300 Subject: [PATCH] =?UTF-8?q?feat(collections):=20=F0=9F=8E=B8=20data=20sear?= =?UTF-8?q?ch,=20translated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refers: #10 --- .../sections/03-data-search.asc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/book/08-java-collections/sections/03-data-search.asc b/book/08-java-collections/sections/03-data-search.asc index 081c6d4..00d2393 100644 --- a/book/08-java-collections/sections/03-data-search.asc +++ b/book/08-java-collections/sections/03-data-search.asc @@ -1,16 +1,14 @@ :java-package: src/org/j6toj8/collections :section-java-package: ../../../{java-package} -=== Buscar por dados +=== Search for data -.Objetivo +.Objective -------------------------------------------------- Search for data by using methods, such as findFirst(), findAny(), anyMatch(), allMatch(), and noneMatch() -- -Buscar por dados utilizando métodos, como findFirst(), findAny(), anyMatch(), allMatch(), e noneMatch() -------------------------------------------------- -. É possível recuperar o primeiro ou um elemento qualquer da coleção. +. You can retrieve the first or any element from the collection. + [source,java,indent=0] .{java-package}/datasearch/DataSearch_FindFirstAny.java @@ -18,14 +16,14 @@ Buscar por dados utilizando métodos, como findFirst(), findAny(), anyMatch(), a include::{section-java-package}/datasearch/DataSearch_FindFirstAny.java[tag=code] ---- + -.Saída no console +.console output [source,console] ---- First: 1 Any: 9 ---- -. É possível verificar se os elementos da coleção atendem ou não a algum critério. +. You can check whether or not collection elements meet any criteria. + [source,java,indent=0] .{java-package}/datasearch/DataSearch_Match.java @@ -33,7 +31,7 @@ Any: 9 include::{section-java-package}/datasearch/DataSearch_Match.java[tag=code] ---- + -.Saída no console +.console output [source,console] ---- anyMatch: true @@ -41,12 +39,13 @@ allMatch: false noneMatch: false ---- +.References **** * Using Streams + -Boyarsky, Jeanne; Selikoff, Scott. OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide (p. 185). Wiley. Edição do Kindle. +Boyarsky, Jeanne; Selikoff, Scott. OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide (p. 185). Wiley. Kindle Edition. * https://www.baeldung.com/java-8-streams[The Java 8 Stream API Tutorial.] -**** \ No newline at end of file +****