<div dir="ltr"><div>Hello.</div><div><br></div><div>
I am new to this list so might have missed previous discussion about 
this but could not find what I was looking for in the archives.</div><div><br></div><div>The Sequenced collections JEP adds the following static methods to java.util.Collections.</div><div><br></div><div>- unmodifiableSequencedCollection</div><div>- unmodifiableSequencedSet</div><div>- unmodifiableSequencedMap<br></div><div><br></div><div>However, the set of static methods returning thread-safe versions of their arguments (like synchronizedCollection, synchronizedSet, and synchronizedMap) has not been extended.</div><div><br></div><div>As a consequence, I don't see a straightforward way to create thread-safe sequenced sets or maps where encounter-order corresponds to insertion order (like LinkedHashSet or LinkedHashMap) and access them as SequencedSet or SequencedMap.</div><div><br></div><div>When using the available methods mentioned above, the result is not a sequenced type.</div><div><br></div><div>For predefined sets and maps where encounter order corresponds to natural order, there are the following methods in java.util.Collections.</div><div><br></div><div>- synchronizedNavigableSet</div><div>- synchronizedNavigableMap</div><div>- synchronizedSortedSet</div><div>- synchronizedSortedMap</div><div><br></div><div>However, these methods cannot be used with LinkedHashSet or LinkedHashMap.</div><div><br></div><div>The following methods would be useful in order to create thread-safe sequenced collections where encounter order is insertion order, but they are currently not provided.<br></div><div><br></div><div>- synchronizedSequencedCollection</div><div>- synchronizedSequencedSet</div><div>- synchronizedSequencedMap<br></div><div><br></div><div>What are the reasons for or against adding these methods?</div><div><br></div><div>There are also no implementations of concurrent sequenced sets and maps where encounter order is insertion order in java.util.concurrent. All of the provided concurrent sequenced sets and maps are based on natural order, and consequently do not support addFirst, and so on.</div><div><br></div><div>Are there plans to add concurrent sequenced collections that support the whole interface of sequenced collections?<br></div><div><br></div><div>Kind regards,</div><div>Sebastian<br>

</div></div>