Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34058
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Sebastian <news@seyweiler.dyndns.org> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: own stream reduction |
| Date | Sat, 02 Apr 2016 23:10:50 +0200 |
| Organization | albasani.net |
| Lines | 24 |
| Message-ID | <ndpcgq$rlf$1@news.albasani.net> (permalink) |
| References | <feb2691d-116f-4519-9c4d-3e01294703aa@googlegroups.com> <ndokfn$7bb$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net Ibg9lzKi+7zOUXtGmksv5Ub92Fw1bnxVp/NbeTI6T8wmZaFTXzrAFSapvFZMUCqKErqJEKC7adnWhrJ6u5AvJg== |
| NNTP-Posting-Date | Sat, 2 Apr 2016 21:10:50 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="j78/xb3Jl0iMbV6zq2XyT+9+WPCFHYhXwHm1Rs30KY7B/Ao2hRfcu8E9fV6xcdQuQ2bKm0x87763DRFL4hUF7Unz7R9xmDnud9+X9Xme7kQslEQvEOOhSKf0Bi316+Sl"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
| In-Reply-To | <ndokfn$7bb$1@dont-email.me> |
| Cancel-Lock | sha1:6fQDNt7X53HGlv8RtDimEaAj7zE= |
| Xref | csiph.com comp.lang.java.programmer:34058 |
Show key headers only | View raw
Am 02.04.2016 16:23, schrieb Eric Sosman: > On 4/2/2016 10:10 AM, Philipp Kraus wrote: >> Hello, >> >> I try to buld an own reduction stream reduction for my data structure. >> [...] >> I'm searching for a tutorial or example how I can create an own reduce >> operator of my own type. > > The Java Tutorial has a page showing how a few simple reduction > operations can be built "from the ground up:" > > http://docs.oracle.com/javase/tutorial/collections/streams/reduction.html In particular, as Stream.reduce() is a general-purpose reduction method, you don't need to define your own reduction, you just need an accumulator. The bodies of the for-loops you have shown are suitable as accumulators: They are associative binary operators on Fuzzy<Boolean>. > Also, the Javadoc for java.util.stream has some material that > looks useful. > -- Sebastian
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
own stream reduction Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-04-02 07:10 -0700
Re: own stream reduction Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-04-02 10:23 -0400
Re: own stream reduction Sebastian <news@seyweiler.dyndns.org> - 2016-04-02 23:10 +0200
Re: own stream reduction Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2016-04-03 08:32 -0700
csiph-web