Skip to content

Commit 3af2baf

Browse files
Merge pull request rage#217 from david145noone/10.1-code-tags
10.1 non-functioning backticks ` with <code>
2 parents 6228c80 + b4fac81 commit 3af2baf

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

data/part-10/1-handling-collections-as-streams.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ A brief summary of the stream methods we've encountered so far.
216216

217217
<tr>
218218
<td>
219-
Stream formation: `stream()`
219+
Stream formation: <code>stream()</code>
220220
</td>
221221
<td>
222222
The method is called on collection that implements the Collection interface, such as an ArrayList Object. Something is done on the created stream.
@@ -225,7 +225,7 @@ A brief summary of the stream methods we've encountered so far.
225225

226226
<tr>
227227
<td>
228-
Converting a stream into an integer stream: `mapToInt(value -> another)`
228+
Converting a stream into an integer stream: <code>mapToInt(value -> another)</code>
229229
</td>
230230
<td>
231231
The stream transforms into one containing integers.
@@ -237,30 +237,30 @@ A brief summary of the stream methods we've encountered so far.
237237
<tr>
238238
<td>
239239
Filtering values:
240-
`filter(value -> filter condition)`
240+
<code>filter(value -> filter condition)</code>
241241
</td>
242242
<td>
243243
The elements that do not satisfy the filter condition are removed from the string.
244244
On the right side of the arrow is a statement that returns a boolean.
245-
If the boolean is `true`, the element is accepted into the stream. If the boolean evaluates to false, the value is not accepted into the stream. Something is done with the filtered values.
245+
If the boolean is <code>true</code>, the element is accepted into the stream. If the boolean evaluates to false, the value is not accepted into the stream. Something is done with the filtered values.
246246
</td>
247247
</tr>
248248

249249
<tr>
250250
<td>
251-
Calculating the average: `average()`
251+
Calculating the average: <code>average()</code>
252252
</td>
253253
<td>
254-
Returns a OptionalDouble-type object that has a method `getAsDouble()` that returns a value of type `double`. Calling the method `average()` works on streams that contain integers - they can be created with the `mapToInt` method.
254+
Returns a OptionalDouble-type object that has a method <code>getAsDouble()</code> that returns a value of type <code>double</code>. Calling the method <code>average()</code> works on streams that contain integers - they can be created with the <code>mapToInt</code> method.
255255
</td>
256256
</tr>
257257

258258
<tr>
259259
<td>
260-
Counting the number of elements in a stream: `count()`
260+
Counting the number of elements in a stream: <code>count()</code>
261261
</td>
262262
<td>
263-
Returns the number of elements in a stream as a `long`-type value.
263+
Returns the number of elements in a stream as a <code>long</code>-type value.
264264
</td>
265265
</tr>
266266

@@ -1288,7 +1288,7 @@ The exercise template includes the probably familiar project "Cargo hold". Howev
12881288
<!-- Virta on myös erittäin näppärä tiedostojen käsittelyssä. Tiedoston lukeminen virtamuotoisena tapahtuu Javan valmiin <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html" target="_blank" rel="noopener">Files</a>-luokan avulla. Files-luokan metodin `lines` avulla tiedostosta voidaan luoda syötevirta, jonka avulla tiedoston rivit voidaan käsitellä yksi kerrallaan. Metodi `lines` saa patametrikseen polun, joka luodaan luokan <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html" target="_blank" rel="noopener">Paths</a> tarjoamalla metodilla `get`, jolle annetaan parametrina tiedostopolkua kuvaava merkkijono.
12891289

12901290
Alla olevassa esimerkissä luetaan tiedoston "tiedosto.txt" kaikki rivit ja lisätään ne listaan. -->
1291-
<p>Streams are also very handy in handling files. The file is read in stream form using Java's ready-made <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html" target="_blank" rel="noopener">Files</a> class. The `lines` method in the files class allows you to create an input stream from a file, allowing you to process the rows one by one. The `lines` method gets a path as its parameter, which is created using the `get` method in the <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html" target="_blank" rel="noopener">Paths</a> class. The `get` method is provided a string describing the file path.</p>
1291+
<p>Streams are also very handy in handling files. The file is read in stream form using Java's ready-made <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html" target="_blank" rel="noopener">Files</a> class. The <code>lines</code> method in the files class allows you to create an input stream from a file, allowing you to process the rows one by one. The <code>lines</code> method gets a path as its parameter, which is created using the <code>get</code> method in the <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html" target="_blank" rel="noopener">Paths</a> class. The <code>get</code> method is provided a string describing the file path.</p>
12921292
12931293
The example below reads all the lines in "file.txt" and adds them to the list.
12941294

data/part-9/2-interfaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ Using interfaces in programming enables reducing dependencies between classes. I
10551055

10561056
<!-- Rajapinta <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html">List</a> määrittelee listoihin liittyvän peruskäyttäytymisen. Koska ArrayList-luokka toteuttaa `List`-rajapinnan, voi sitä käyttää myös `List`-rajapinnan kautta. -->
10571057

1058-
<p>The <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html">List</a> interface defines the basic functionality related to lists. Because the ArrayList class implements the `List` interface, one can also use it through the `List` interface.</p>
1058+
<p>The <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html">List</a> interface defines the basic functionality related to lists. Because the ArrayList class implements the <code>List</code> interface, one can also use it through the <code>List</code> interface.</p>
10591059

10601060
<br/>
10611061

@@ -1071,7 +1071,7 @@ strings.add("string objects inside an arraylist object!");
10711071

10721072
<!-- Kuten huomaamme <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html" target="_blank">List-rajapinnan Java API</a>:sta, rajapinnan `List` toteuttavia luokkia on useita. Eräs tietojenkäsittelijöille tuttu listarakenne on linkitetty lista (<a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" target="_blank">linked list</a>). Linkitettyä listaa voi käyttää rajapinnan List-kautta täysin samoin kuin ArrayLististä luotua oliota. -->
10731073

1074-
<p>As we can see fom the <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html" target="_blank">Java API</a> of List, there are many classes that implement the `List` interface. One list that is familiar to computer scientists is a <a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" target="_blank">linked list</a>. A linked list can be used through the List interface exactly the same way as an object created from ArrayList.</p>
1074+
<p>As we can see fom the <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html" target="_blank">Java API</a> of List, there are many classes that implement the <code>List</code> interface. One list that is familiar to computer scientists is a <a href="http://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html" target="_blank">linked list</a>. A linked list can be used through the List interface exactly the same way as an object created from ArrayList.</p>
10751075

10761076
<br/>
10771077

0 commit comments

Comments
 (0)