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),
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
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
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
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"
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
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
> 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;
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