BetterLists 1.4

This commit is contained in:
Klemek
2018-06-18 15:10:34 +02:00
parent c9f641a4a4
commit 55dcf214f5
4 changed files with 41 additions and 8 deletions
+6 -5
View File
@@ -30,7 +30,7 @@ NOTE : Please note that, unlike C# LINQ, these functions are not optimized at lo
## Download
* [betterlists-1.3.jar](../../raw/master/download/betterlists-1.3.jar)
* [betterlists-1.4.jar](../../raw/master/download/betterlists-1.4.jar)
## Maven
@@ -49,7 +49,7 @@ You can use this project as a maven dependency with this :
<dependency>
<groupId>klemek</groupId>
<artifactId>betterlists</artifactId>
<version>1.3</version>
<version>1.4</version>
</dependency>
</dependencies>
```
@@ -71,7 +71,7 @@ You can use this project as a maven dependency with this :
| [orderBy / orderByDescending](#orderby-orderbydescending) | Sorts the elements of a sequence in ascending order by using a specified comparator. (You can user orderByDescending to change the order) |
| [reverse](#reverse) | Inverts the order of the elements in the sequence. |
| [select](#select) | Projects each element of a sequence into a new form. |
| [selectMany](#selectmany) | Projects each element of a sequence into a new list and flattens the resulting sequences into one sequence. |
| [selectMany / selectManyArrays](#selectmany-selectmanyarrays) | Projects each element of a sequence into a new list and flattens the resulting sequences into one sequence. |
| [skip / skipWhile](#skip-skipwhile) | Bypasses elements in the sequence as long as a specified condition is true and then returns the remaining elements. |
| [sum](#sum) | Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. |
| [take / takeWhile](#take-takewhile) | Returns a specified number of contiguous elements from the start of the sequence. |
@@ -178,12 +178,13 @@ BetterArrayList<Contact> contacts = BetterArrayList.fromList(someFunction());
BetterList<String> contactsMails = contacts.select(c -> c.getEmail());
```
### selectMany
### selectMany / selectManyArrays
Projects each element of a sequence into a new list and flattens the resulting sequences into one sequence.
```Java
BetterArrayList<Contact> contacts = BetterArrayList.fromList(someFunction());
BetterList<String> contactsMails = contacts.select(c -> c.getEmail().split(";"));
BetterList<String> contactsNumbers = contacts.selectMany(c -> c.getAllPhoneNumbers());
BetterList<String> contactsMails = contacts.selectManyArrays(c -> c.getEmail().split(";"));
```