DoublyLinkedList
The DoublyLinkedList
class provides a data structure implementing mutable doubly-linked lists. next --> --> tail (last car) --> [e1] [e2] [e3] <-- head (lead car) prev <-- <--
Value parameters
- A
-
the type of the elements/values in the list
Attributes
- Graph
-
- Supertypes
-
trait Serializableclass AbstractIterable[A]trait Iterable[A]class AbstractIterable[A]trait Iterable[A]trait IterableFactoryDefaults[A, Iterable]trait IterableOps[A, Iterable, Iterable[A]]trait IterableOnceOps[A, Iterable, Iterable[A]]trait IterableOnce[A]class Objecttrait Matchableclass AnyShow all
Members list
Type members
Classlikes
The ListIterator
inner class supports iterating over all the elements in this list.
The ListIterator
inner class supports iterating over all the elements in this list.
Value parameters
- ns
-
the starting node (defaults to tail)
Attributes
- Supertypes
-
trait Iterator[A]trait IterableOnceOps[A, Iterator, Iterator[A]]trait IterableOnce[A]class Objecttrait Matchableclass AnyShow all
The Node
inner case class wraps elements in nodes for double linkage.
The Node
inner case class wraps elements in nodes for double linkage.
Value parameters
- elem
-
the element
- next
-
the successor node (car behind)
- prev
-
the predecessor node (car ahead)
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The NodeIterator
inner class supports iterating over all the nodes in this list.
The NodeIterator
inner class supports iterating over all the nodes in this list.
Value parameters
- ns
-
the starting node (defaults to tail)
Attributes
- Supertypes
Value members
Concrete methods
Add the new element into the list BEFORE the given successor node nn
and return the new node n
. Relink: pn <-> nn TO pn <-> n <-> nn
Add the new element into the list BEFORE the given successor node nn
and return the new node n
. Relink: pn <-> nn TO pn <-> n <-> nn
Value parameters
- elm
-
the element to be added
- nn
-
the successor(next) node (defaults to tail if not given)
Attributes
- Returns
-
the new node
n
Add the new element into the list AFTER the given predecessor node pn
and return the new node n
. Relink: pn <-> n <-> nn
Add the new element into the list AFTER the given predecessor node pn
and return the new node n
. Relink: pn <-> n <-> nn
Value parameters
- elm
-
the element to be added
- pn
-
the predecessor node (defaults to head if not given)
Attributes
- Returns
-
the new node
n
Add the new element BEFORE the given successor node nn
and return the new node n
. Relink: pn <-> nn TO pn <-> n <-> nn The predecessor (pn
) of the successor node nn
is relinked to point to the new node n
. Similarly, the new node n
links back to pn
and forward to nn
. If nn
is null
, this method adds the element as the first element in the list.
Add the new element BEFORE the given successor node nn
and return the new node n
. Relink: pn <-> nn TO pn <-> n <-> nn The predecessor (pn
) of the successor node nn
is relinked to point to the new node n
. Similarly, the new node n
links back to pn
and forward to nn
. If nn
is null
, this method adds the element as the first element in the list.
Value parameters
- elm
-
the element to be added
- nn
-
the successor node (defaults to
null
if not provided)
Attributes
- Returns
-
the newly created node
n
inserted before nodenn
Add the first element to an empty list and return the new node n.
Add the first element to an empty list and return the new node n.
Value parameters
- elm
-
the element to be added
Attributes
- Returns
-
the new node added n
Clear the list of all nodes (and their elements).
Clear the list of all nodes (and their elements).
Attributes
Retrieve the element in node n (e.g., the current car).
Retrieve the element in node n (e.g., the current car).
Value parameters
- n
-
the node containing the sought element
Attributes
Return the head/first node in the list (e.g, node holding the first car).
Return the head/first node in the list (e.g, node holding the first car).
Attributes
- Definition Classes
-
IterableOps
Return whether the list is empty (head and tail are null).
Return whether the list is empty (head and tail are null).
Attributes
- Definition Classes
-
IterableOnceOps
Return an iterator for retrieving all the elements in this list.
Return an iterator for retrieving all the elements in this list.
Attributes
- See also
-
scala.collection.IterableOnce
Return the tail/last node in the list (e.g, node holding the last car).
Return the tail/last node in the list (e.g, node holding the last car).
Attributes
- Definition Classes
-
IterableOps
Return an iterator for retrieving all the nodes in this list.
Return an iterator for retrieving all the nodes in this list.
Attributes
- See also
-
scala.collection.IterableOnce
Remove the node n
from the linked list. Relink: pn <-> n <-> nn TO pn <-> nn
Remove the node n
from the linked list. Relink: pn <-> n <-> nn TO pn <-> nn
Value parameters
- n
-
the node to remove (unlink)
Attributes
Convert the elements of this doubly linked list to a Scala List. This method is efficient in terms of maintaining the correct order without nneeding a separate reverse at the end.
Convert the elements of this doubly linked list to a Scala List. This method is efficient in terms of maintaining the correct order without nneeding a separate reverse at the end.
Attributes
- Definition Classes
-
IterableOnceOps
Convert this doubly linked list to a string.
Convert this doubly linked list to a string.
Attributes
- Definition Classes
-
Iterable -> Any
Inherited methods
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
IterableFactoryDefaults -> IterableOps
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
Iterable -> Iterable -> IterableOps
- Inherited from:
- Iterable
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- Iterable
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Deprecated and Inherited methods
Attributes
- Deprecated
-
[Since version 2.13.0]
Use ++ instead of ++: for collections of type Iterable - Inherited from:
- IterableOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldLeft instead of /: - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldRight instead of :\\ - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`. - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use iterableFactory instead - Inherited from:
- IterableOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use `dest ++= coll` instead - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details) - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use coll instead of repr in a collection implementation, use the collection value itself from the outside - Inherited from:
- IterableOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Iterable.seq always returns the iterable itself - Inherited from:
- Iterable
Attributes
- Deprecated
-
[Since version 2.13.7]
toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections - Inherited from:
- Iterable
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .iterator instead of .toIterator - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections - Inherited from:
- IterableOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .view.slice(from, until) instead of .view(from, until) - Inherited from:
- IterableOps