![](/img/trans.png)
[英]Trying to solve a problem using stream API to find the chunk size. Giving error at .collect(Collectors.toList(ArrayList<int[]>::new)). Java 8+ Stream
我試圖使用 Java 8 stream 打印數組,它應該將類型 List<int[]> 返回到主 function。代碼中提到了示例輸入。 ...
[英]Trying to solve a problem using stream API to find the chunk size. Giving error at .collect(Collectors.toList(ArrayList<int[]>::new)). Java 8+ Stream
我試圖使用 Java 8 stream 打印數組,它應該將類型 List<int[]> 返回到主 function。代碼中提到了示例輸入。 ...
[英]JAVA 8 distinctByKey
誰能幫幫我,這行是什么意思-------> return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; 為什么將 lambda 結果與 null 進行比較? ...
[英]Java 8 Stream query - need to replace if inside for each with some streams method
這里請求包含客戶列表,客戶列表有通信地址,通信地址有 2 個字段。 我正在嘗試將這些字段映射到自定義屬性列表。 有什么方法可以用一些流方法替換每個塊的 if in 嗎? ...
[英]Trading veiw Lightweight graph set timescale at one hour
我目前正在為我的燭台圖使用輕量級圖表,但我遇到了一個問題。 我如何在燭台中設置我的數據。 我的數據。 我如何設置此數據需要幫助! ...
[英]Filtering Java Nested List
我有一個學校列表,其中包含 class、class 列表,其中還包含學生和學生也是另一個列表。 我想應用兩個嵌套過濾器,首先檢查是否有任何 class 有一個空的學生列表,第二個過濾器用於檢查學校是否有任何空的 class 列表,最后它應該返回列表,但我不能應用兩個過濾器嵌套時,我不斷收到語法錯誤。 ...
[英]How can I group Stream<Person> into Stream<List<Person>>, not into Map<String, <List<Person>>?
我有 POJO class:@Data @AllArgsConstructor public class Person { private String name; private String surname; } 我有一些可執行代碼:public class Main { ...
[英]Group by Stream API for List API
我有一個返回值列表的代碼塊,但我需要按特定值分組 返回休息為 所以我更改了上面的代碼以獲取基於區域編號的所有觀察結果 當我運行空閑代碼時,我必須對每個單獨的觀察結果進行分組 預期反應 ] ...
[英]Concat stream lines before collecting them
簡單地說,下面的代碼產生了一個五行的流,我需要將這些行合並成一行(在流式傳輸時)以供進一步使用和收集它們之前。代碼即將將一個字符串轉換為一個長二進制字符串 Stream<String> binText = "hello".chars() .mapToObj(x-> Inte ...
[英]Java Stream: How to avoid add null value in Collectors.toList()?
有一些 Java 代碼: 如果調用變量是 null,如何避免避免添加到最終列表? ...
[英]How to group map values after Collectors.groupingBy() without using forEach
我有一個 ProductDto 對象列表,我想使用 java 8 流 Collectors.groupingBy() 將它們分組為類似的對象。 對記錄進行分組后,我想將相似的記錄合並為單個 productDto。 為了實現這一點,我使用了 map.forEach 並得到了預期的結果,但我想避免 fo ...
[英]Get index where the element matches using lightweight stream API stream
我有以下 stream 並且我將這個庫用於流: 我想運行 stream 來獲取值匹配時的索引。 我知道我可以使用一個簡單的 for 循環來實現它: 當使用輕量級 stream API 值匹配時,我將如何獲取索引。 ...
[英]Rewrite java 8 method with Lightweight-Stream-API for using for api 21
我不知道Stream API的所有功能。 我有一個自定義適配器的AutoCompleteTextView ,我做了一個方法,知道AutoCompleteTextView輸入的數據是否來自建議的數據, 現在我想使用Lightweight-Stream-API重寫它以便在api 24下使 ...
[英]Get max and maxIndex of sum of two lists of floats in java fast
我正在嘗試使用“輕量級流”以比我下面管理的更快的方式來計算兩個列表的最大和對: ...