Append an item to this list.
Append an item to this list. This operation is O(n) where n
is the number
of items in the underlying List
, and returns the updated list.
Returns true if this list contains the given obj
.
Returns true if this list contains the given obj
.
Prepends an item to this list.
Prepends an item to this list. This operation is O(1) and returns the updated list.
An immutable singly linked list that uses the Scala List class as backing store, but is Java-friendly as a
java.util.List
. Note however that since it is immutable, you have to capture the results of addition/removal operations.The typical mutating methods like
add
,set
,clear
, andremove
are all unsupported, as are mutating methods on its iterators, since this collection is immutable.