Re: [DISCUSSs] new Iterator

2024-10-20 Thread Claude Warren
I can see a future enhancement (or iterator type) that merges iterators together in a round-robin strategy. While I don't have a need for this at the moment and so will not provide an implementation. Consider a system where multiple polled IoT devices only report abnormal values (e.g. only when i

Re: [DISCUSSs] new Iterator

2024-10-20 Thread Claude Warren
@Gary Gregory in response to your comments on "ofStream". I was thinking of renaming it to "fromStream" but then realized that it is really just another implementation of "create" so ExtendedIterator create(Stream stream) is what I am proposing now. In response to the comments on `addTo` Strea

Re: [DISCUSSs] new Iterator

2024-10-19 Thread Claude Warren
@mdrob The reason to use an Iterator is that, from my experience, Stream requires all the base objects to be in existence. In addition there are times when you don't know how many objects there will be or that you have an iterator or iterable to start with and not a stream. An example would be r

Re: [DISCUSSs] new Iterator

2024-10-19 Thread Gary D. Gregory
On 2024/10/19 18:44:17 "Gary D. Gregory" wrote: > On 2024/10/19 16:16:09 "Gary D. Gregory" wrote: > > > > On 2024/10/19 16:12:45 "Gary D. Gregory" wrote: > > > Hi Claude, > > > > > > Interesting stuff :-) > > > > > > I'll assume that you intend this discussion for Commons Collections. Note >

Re: [DISCUSSs] new Iterator

2024-10-19 Thread Gary D. Gregory
On 2024/10/19 16:16:09 "Gary D. Gregory" wrote: > > On 2024/10/19 16:12:45 "Gary D. Gregory" wrote: > > Hi Claude, > > > > Interesting stuff :-) > > > > I'll assume that you intend this discussion for Commons Collections. Note > > that there are some stream/iterator mix utilities in Commons Lan

Re: [DISCUSSs] new Iterator

2024-10-19 Thread Gary D. Gregory
Hi Claude, Interesting stuff :-) I'll assume that you intend this discussion for Commons Collections. Note that there are some stream/iterator mix utilities in Commons Lang in the org.apache.commons.lang3.stream.Streams class. A few comments below. On 2024/10/19 10:15:38 Claude Warren wrote:

Re: [DISCUSSs] new Iterator

2024-10-19 Thread Gary D. Gregory
On 2024/10/19 16:12:45 "Gary D. Gregory" wrote: > Hi Claude, > > Interesting stuff :-) > > I'll assume that you intend this discussion for Commons Collections. Note > that there are some stream/iterator mix utilities in Commons Lang in the > org.apache.commons.lang3.stream.Streams class. > >

Re: [DISCUSSs] new Iterator

2024-10-19 Thread Mike Drob
What is the advantage of using an ExtendedIterator to filter/chain/map/flatten instead of using Stream to do the same? On Sat, Oct 19, 2024 at 5:16 AM Claude Warren wrote: > I would like to introduce a new Iterator to the iterator library: > ExtendedIterator > > This Iterator is an Iterator that

[DISCUSSs] new Iterator

2024-10-19 Thread Claude Warren
I would like to introduce a new Iterator to the iterator library: ExtendedIterator This Iterator is an Iterator that extends the functionality of other iterators and makes using some iterators in the library more idiomatic. It is based on the ExtendedIterator found in the new Apache Rat core pack