Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet

2020-04-29 Thread Stuart Marks
On 4/28/20 9:48 PM, Jason Mehrens wrote: Looks like It is intentional that unmodifiable queues are not present. See: https://bugs.openjdk.java.net/browse/JDK-5030930. The same logic would have been used for when Deque was added in the following release. Good find. Looking at the Queue i

Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet

2020-04-28 Thread Tagir Valeev
Hello, Paul and Stuart! Thank you for sharing your thoughts regarding my proposal. Yes, the proposal was triggered by twitter discussion but I needed this functionality occasionally in my daily work several times. Sorry for mixing the goal and possible solution, so let's start again. The goal of

Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet

2020-04-28 Thread Jason Mehrens
of Stuart Marks Sent: Tuesday, April 28, 2020 6:57 PM To: Paul Sandoz Cc: core-libs-dev Subject: Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet Hi Paul, I too hesitate about adding Ordered* interfaces. As I said previously, I don't think they're very useful, and th

Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet

2020-04-28 Thread Stuart Marks
Hi Paul, I too hesitate about adding Ordered* interfaces. As I said previously, I don't think they're very useful, and they do seem rather Queue- or Deque-like. Indeed, Tagir was musing the other day on Twitter about a Deque view of LinkedHashSet and possibly LinkedHashMap. I think that might

Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet

2020-04-28 Thread Paul Sandoz
Hi Tagir, I am hesitant to add new interfaces specific to Set/Map for a non-indexed encounter order. The interface OrderedSet is tantalizingly queue-like, in fact rather close to the read-only part of Deque. Did you consider the possibility of LinkedHashSet implementing Deque? I have not tho

Re: LinkedHashMap/LinkedHashSet enhancement: OrderedMap/OrderedSet

2020-04-27 Thread Stuart Marks
Hi Tagir, A few quick thoughts on this. There does seem to be a conceptual hole here. Most collections implementations have an obvious interface that provides a reasonable abstraction of that implementation. However, one is "missing" for LinkedHashSet, since there's no interface more speciali