Re: [External] : Re: Sequenced Collections

2022-10-10 Thread Stuart Marks
It sounds like you're after some generalized notion of "consistency", and the fact that offer*() return a boolean whereas add*() do not seems inconsistent. Unfortunately, the methods have different semantics. After add(obj), obj is *always* a member of the collection, whereas after offer*(obj),

Re: Sequenced Collections

2022-10-05 Thread Ernie Rael
On 10/5/22 9:34 AM, Stuart Marks wrote: On 10/4/22 9:38 PM, Ernie Rael wrote: Summary of key points (maybe the mail was TL;DR) OK thanks, I was still mulling over the previous email wondering which parts were significant enough to reply to.   * SequencedCollection methods addFirst,addLas

Re: Sequenced Collections

2022-10-05 Thread Stuart Marks
On 10/4/22 9:38 PM, Ernie Rael wrote: Summary of key points (maybe the mail was TL;DR) OK thanks, I was still mulling over the previous email wondering which parts were significant enough to reply to.  * SequencedCollection methods addFirst,addLast are the only methods in    Collection

Re: Sequenced Collections

2022-10-04 Thread Ernie Rael
Summary of key points (maybe the mail was TL;DR) * SequencedCollection methods addFirst,addLast are the only methods in Collection hierarchy (AFAIK) that might modify the collection and do not return/signal if the collection was modified. Seems like offerFirst,offerLast are more consist

Re: Sequenced Collections

2022-09-26 Thread Ernie Rael
On 9/26/22 11:31 AM, Ernie Rael wrote: maybe "interface ListIteratorProvider { ListIterator listIterator(int index); }" Doh! I guess that should be "interface ListIterable"

Re: Sequenced Collections

2022-09-26 Thread Ernie Rael
A SequencedCollection listIterator() is missed; it's useful for List.equals, or to implement a List in general. LinkedHashSet seems incomplete without it. Even something like "ListIterator Collections.forwardListIterator(int index, iterator)", if compatible with equals() of the various list typ

Re: Sequenced Collections

2022-09-21 Thread Stuart Marks
Hi, yes, this is the right place to discuss Sequenced Collections. I'm glad you find it promising. Note that Sequenced Collections actually has very little implementation in it, aside from various reversed views of things. The actual data is still stored in existing concrete collections such a

Re: Sequenced Collections

2022-09-21 Thread Ernie Rael
> I don't see why you think a general collection... I thought the Subject would be sufficient to indicate that I was not talking about collections in general. I should have been more precise with my words; guess I was just excited by a bi-directional ordered set. The MRU _example_ is useful;

Re: Sequenced Collections

2022-09-21 Thread John Hendrikx
I don't see why you think a general collection, that is in 99.9% of the cases not used to implement an MRU, should burden every call to #add with a check to see if it isn't exceeding its maximum size or to see if a maximum size has been set. This is much better done by composition, as I don't