Import std.collections.linked_list
std.collections.linked_list
LinkedList<T>: values in a chain of nodes, each linked to the ones before and after it, so
adding or removing one beside a node takes the same time however many there are. A node is the
same object for as long as it's in the list, so code can keep one to add beside or remove
later. Each node holds the one after it and, weakly, the one before, so the list makes no
cycles, and Clear and the list's end unlink every node, so a node kept elsewhere holds none of
the others.
std/collections/linked_list.fb
Types
LinkedListNode
class
Public Class LinkedListNode<T>
One value of a LinkedList, with the ones before and after it, which inserting and removing next to it go through.
std/collections/linked_list.fb, line 13
-
Its value.
-
The node after this one, or Null when it's the last or not in a list.
-
The node before this one, or Null when it's the first or not in a list.
-
The list it's in, or Null once it's removed.
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.
std/collections/linked_list.fb, line 43
-
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.
LinkedListIterator
struct
Public Struct LinkedListIterator<T> Implements Iterator<T>
The values of a LinkedList, first to last, which For ... In goes over.
std/collections/linked_list.fb, line 337
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Extends
LinkedList
extend
Extend LinkedList<T> Implements Equatable
No doc comment.
std/collections/linked_list.fb, line 356
-
Whether
aandbare equal.Doc from
std.core.interfaces.Equatable.Operator==.
LinkedList
extend
Extend LinkedList<T> Implements Printable
No doc comment.
std/collections/linked_list.fb, line 373
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Report an issue with this page or with FutureBlitz on GitHub.