A LinkedList is needed for a custom LRU implementation. When looking at the source we see:
@deprecated("Low-level linked lists are deprecated
due to idiosyncrasies in interface and incomplete features.", "2.11.0")
class LinkedList[A]() extends AbstractSeq[A]
with LinearSeq[A]
with GenericTraversableTemplate[A, LinkedList]
with LinkedListLike[A, LinkedList[A]]
with Serializable {
So then what is the recommended alternative (none mentioned here..). Do we fall back to the java.util.LinkedList
? I am guessing there were a better option ..
Update The specific characteristic of LinkedList that is needed is the ability to access an individual entry on O(1) in order to insert/remove elements in the list efficiently. This would require that a LinkedListEntry
(or Node
or similar ..) reference be exposed and returned upon creation of new element in the list. It appears none of the available implementations - including java.util.LinkedList
- are suitable.