DoublyLinkedList

scalation.DoublyLinkedList
class DoublyLinkedList[A] extends AbstractIterable[A], Serializable

The DoubleLinked class provides a data structure implementing mutable doubly-linked lists. succ --> --> tail (last car) --> [e1] [e2] [e3] <-- head (lead car) pred <-- <--

Type parameters

A

the type of the elements/values in the list

Attributes

Graph
Supertypes
trait Serializable
class 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 Object
trait Matchable
class Any
Show all

Members list

Type members

Classlikes

class ListIterator(ns: Node) extends Iterator[A]

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 leaf node (defaults to tail)

Attributes

Supertypes
trait Iterator[A]
trait IterableOnceOps[A, Iterator, Iterator[A]]
trait IterableOnce[A]
class Object
trait Matchable
class Any
Show all
case class Node(elem: A, var pred: Node, var succ: Node)

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

pred

the predecessor node

succ

the successor node

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class NodeIterator(ns: Node) extends Iterator[Node]

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
trait Iterator[Node]
trait IterableOnceOps[Node, Iterator, Iterator[Node]]
trait IterableOnce[Node]
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def add(elm: A, sn: Node): Node

Add the new element into the list BEFORE the given successor node sn and return the new node nn. Relink: pn <-> sn TO pn <-> nn <-> sn

Add the new element into the list BEFORE the given successor node sn and return the new node nn. Relink: pn <-> sn TO pn <-> nn <-> sn

Value parameters

elm

the element to be added

sn

the successor node (use tail if not given)

Attributes

def addAfter(elm: A, pn: Node): Node

Add the new element into the list AFTER the given predecessor node pn and return the new node nn. Relink: pn <-> sn TO pn <-> nn <-> sn

Add the new element into the list AFTER the given predecessor node pn and return the new node nn. Relink: pn <-> sn TO pn <-> nn <-> sn

Value parameters

elm

the element to be added

pn

the predecessor node (use head if not given)

Attributes

def addFirst(elm: A): Node

Add the first element to an empty list and return the new node nn.

Add the first element to an empty list and return the new node nn.

Value parameters

elm

the element to be added

Attributes

def clear(): Unit

Clear the list of all nodes (and their elements).

Clear the list of all nodes (and their elements).

Attributes

def elemAt(nn: Node): A

Retreive the element in node nn (e.g., the current car).

Retreive the element in node nn (e.g., the current car).

Value parameters

nn

the node containing the sought element

Attributes

override def head: A

Return the lead/first element/node in the list (e.g, node holding the lead car).

Return the lead/first element/node in the list (e.g, node holding the lead car).

Attributes

Definition Classes
IterableOps
def headNode: Node
override def isEmpty: Boolean

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
def iterator: Iterator[A]

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

override def last: A

Return the trail/last element/node in the list (e.g, node holding the trail car).

Return the trail/last element/node in the list (e.g, node holding the trail car).

Attributes

Definition Classes
IterableOps
def lastNode: Node
def nodeIterator: Iterator[Node]

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

def remove(nn: Node): Unit

Remove the node nn from the linked list. Relink: pn <-> nn <-> sn TO pn <-> sn

Remove the node nn from the linked list. Relink: pn <-> nn <-> sn TO pn <-> sn

Value parameters

nn

the node to remove (unlink)

Attributes

override def toString(): String

Convert this doubly linked list to a string.

Convert this doubly linked list to a string.

Attributes

Definition Classes
Iterable -> Any

Inherited methods

final def ++[B >: A](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
final def addString(b: StringBuilder): b.type

Attributes

Inherited from:
IterableOnceOps
final def addString(b: StringBuilder, sep: String): b.type

Attributes

Inherited from:
IterableOnceOps
def addString(b: StringBuilder, start: String, sep: String, end: String): b.type

Attributes

Inherited from:
IterableOnceOps
def collect[B](pf: PartialFunction[A, B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

Attributes

Inherited from:
IterableOnceOps
def concat[B >: A](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: A](xs: Array[B], start: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: A](xs: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def count(p: A => Boolean): Int

Attributes

Inherited from:
IterableOnceOps
def drop(n: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
def dropRight(n: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
def dropWhile(p: A => Boolean): Iterable[A]

Attributes

Inherited from:
IterableOps
override def empty: Iterable[A]

Attributes

Definition Classes
IterableFactoryDefaults -> IterableOps
Inherited from:
IterableFactoryDefaults
def exists(p: A => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def filter(pred: A => Boolean): Iterable[A]

Attributes

Inherited from:
IterableOps
def filterNot(pred: A => Boolean): Iterable[A]

Attributes

Inherited from:
IterableOps
def find(p: A => Boolean): Option[A]

Attributes

Inherited from:
IterableOnceOps
def flatMap[B](f: A => IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def flatten[B](implicit asIterable: A => IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, A) => B): B

Attributes

Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (A, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def forall(p: A => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def foreach[U](f: A => U): Unit

Attributes

Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[A]): Iterable[A]

Attributes

Inherited from:
IterableFactoryDefaults
def groupBy[K](f: A => K): Map[K, Iterable[A]]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: A => K)(f: A => B): Map[K, Iterable[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: A => K)(f: A => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps
def grouped(size: Int): Iterator[Iterable[A]]

Attributes

Inherited from:
IterableOps
def headOption: Option[A]

Attributes

Inherited from:
IterableOps
def init: Iterable[A]

Attributes

Inherited from:
IterableOps
def inits: Iterator[Iterable[A]]

Attributes

Inherited from:
IterableOps
override def isTraversableAgain: Boolean

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
override def iterableFactory: IterableFactory[Iterable]

Attributes

Definition Classes
Iterable -> Iterable -> IterableOps
Inherited from:
Iterable
def knownSize: Int

Attributes

Inherited from:
IterableOnce
def lastOption: Option[A]

Attributes

Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[A, B, Iterable.this.type]

Attributes

Inherited from:
Iterable
def map[B](f: A => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def max[B >: A](implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def maxBy[B](f: A => B)(implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def maxByOption[B](f: A => B)(implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def maxOption[B >: A](implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def min[B >: A](implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def minBy[B](f: A => B)(implicit ord: Ordering[B]): A

Attributes

Inherited from:
IterableOnceOps
def minByOption[B](f: A => B)(implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
def minOption[B >: A](implicit ord: Ordering[B]): Option[A]

Attributes

Inherited from:
IterableOnceOps
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps
final def mkString(start: String, sep: String, end: String): String

Attributes

Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[A, Iterable[A]]

Attributes

Inherited from:
IterableFactoryDefaults
def nonEmpty: Boolean

Attributes

Inherited from:
IterableOnceOps
def partition(p: A => Boolean): (Iterable[A], Iterable[A])

Attributes

Inherited from:
IterableOps
def partitionMap[A1, A2](f: A => Either[A1, A2]): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def product[B >: A](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def reduce[B >: A](op: (B, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeft[B >: A](op: (B, A) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceOption[B >: A](op: (B, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceRight[B >: A](op: (A, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: A](op: (A, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
protected def reversed: Iterable[A]

Attributes

Inherited from:
IterableOnceOps
def scan[B >: A](z: B)(op: (B, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanLeft[B](z: B)(op: (B, A) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanRight[B](z: B)(op: (A, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def size: Int

Attributes

Inherited from:
IterableOnceOps
def sizeCompare(that: Iterable[_]): Int

Attributes

Inherited from:
IterableOps
def sizeCompare(otherSize: Int): Int

Attributes

Inherited from:
IterableOps
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps
def slice(from: Int, until: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
def sliding(size: Int, step: Int): Iterator[Iterable[A]]

Attributes

Inherited from:
IterableOps
def sliding(size: Int): Iterator[Iterable[A]]

Attributes

Inherited from:
IterableOps
def span(p: A => Boolean): (Iterable[A], Iterable[A])

Attributes

Inherited from:
IterableOps
override def splitAt(n: Int): (Iterable[A], Iterable[A])

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S

Attributes

Inherited from:
IterableOnce
def sum[B >: A](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def tail: Iterable[A]

Attributes

Inherited from:
IterableOps
def tails: Iterator[Iterable[A]]

Attributes

Inherited from:
IterableOps
def take(n: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
def takeRight(n: Int): Iterable[A]

Attributes

Inherited from:
IterableOps
def takeWhile(p: A => Boolean): Iterable[A]

Attributes

Inherited from:
IterableOps
override def tapEach[U](f: A => U): Iterable[A]

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def to[C1](factory: Factory[A, C1]): C1

Attributes

Inherited from:
IterableOnceOps
def toArray[B >: A : ClassTag]: Array[B]

Attributes

Inherited from:
IterableOnceOps
final def toBuffer[B >: A]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps
def toIndexedSeq: IndexedSeq[A]

Attributes

Inherited from:
IterableOnceOps
def toList: List[A]

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: A <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
def toSeq: Seq[A]

Attributes

Inherited from:
IterableOnceOps
def toSet[B >: A]: Set[B]

Attributes

Inherited from:
IterableOnceOps
def toVector: Vector[A]

Attributes

Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: A => Iterable[B]): Iterable[Iterable[B]]

Attributes

Inherited from:
IterableOps
def unzip[A1, A2](implicit asPair: A => (A1, A2)): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

Attributes

Inherited from:
IterableOps
def view: View[A]

Attributes

Inherited from:
IterableOps
def withFilter(p: A => Boolean): WithFilter[A, Iterable]

Attributes

Inherited from:
IterableOps
def zip[B](that: IterableOnce[B]): Iterable[(A, B)]

Attributes

Inherited from:
IterableOps
def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]

Attributes

Inherited from:
IterableOps
def zipWithIndex: Iterable[(A, Int)]

Attributes

Inherited from:
IterableOps

Deprecated and Inherited methods

def ++:[B >: A](that: IterableOnce[B]): Iterable[B]

Attributes

Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from:
IterableOps
final def /:[B](z: B)(op: (B, A) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (A, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, A) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] `aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.
Inherited from:
IterableOnceOps
def companion: IterableFactory[Iterable]

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: A](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps
def hasDefiniteSize: Boolean

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def repr: Iterable[A]

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
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

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
final def toIterator: Iterator[A]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[A]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
final def toTraversable: Iterable[A]

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
def view(from: Int, until: Int): View[A]

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps