Skip to content

Commit

Permalink
feat(collections): 🎸 data search, translated
Browse files Browse the repository at this point in the history
Refers: #10
  • Loading branch information
rcmoutinho committed Sep 13, 2019
1 parent 5a0c6cc commit 2bc320e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions book/08-java-collections/sections/03-data-search.asc
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
: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
----
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
----
include::{section-java-package}/datasearch/DataSearch_Match.java[tag=code]
----
+
.Saída no console
.console output
[source,console]
----
anyMatch: true
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.]
****
****

0 comments on commit 2bc320e

Please sign in to comment.