Import std.collections.linked_list
LinkedList
class
@DebugElements Public Class LinkedList<T> Implements Iterable<T>, Cloneable, Defaultable
A doubly linked list, which inserts and removes anywhere it has a node without moving the rest.
Examples
Local list = LinkedList<String>()
Local b = list.Add("b")
list.AddFirst("a")
list.AddAfter(b, "c")
Expect(list.ToArray() == ["a", "b", "c"])
list.RemoveNode(b)
Expect(list.ToArray() == ["a", "c"])
Expect(b.List == Null)std/collections/linked_list.fb, line 69
-
How many values it holds.
-
The first node, or Null when the list is empty.
-
The last node, or Null when the list is empty.
-
The first value. Panics when the list is empty.
-
The last value. Panics when the list is empty.
-
The first value, or Null when the list is empty.
-
The last value, or Null when the list is empty.
-
Adds the
valueat the start, and gives its node. -
Adds the
valueat the end, and gives its node. -
The same as AddLast.
-
Adds each of the
valuesat the end, in order, all read first. -
@PanicsAtCaller Public Method AddBefore(node: LinkedListNode<T>, value: T): LinkedListNode<T>method #Adds the
valuejust beforenode, which has to be in this list, and gives its node. -
@PanicsAtCaller Public Method AddAfter(node: LinkedListNode<T>, value: T): LinkedListNode<T>method #Adds the
valuejust afternode, which has to be in this list, and gives its node. -
Takes
node, which has to be in this list, out of it. -
Takes out the first
valueequal tovalue, and tells whether there was one. -
Takes the first value out and gives it. Panics when the list is empty.
-
Takes the last value out and gives it. Panics when the list is empty.
-
Takes the first value out and gives it, or Null when the list is empty.
-
Takes the last value out and gives it, or Null when the list is empty.
-
The first node whose value is equal to
value, or Null. -
The last node whose value is equal to
value, or Null. -
Whether it holds
value. -
The first value that
testsays is the one, or Null. -
The last value that
testsays is the one, or Null. -
Takes every value out. Their nodes are no longer in a list.
-
The values, first to last, in a new array.
-
A new, empty LinkedList.
-
A new LinkedList with the same values, in nodes of its own.
-
The values, first to last. Setting a node's Value while going over them is fine, but adding or removing one panics.
Report an issue with this page or with FutureBlitz on GitHub.