-
Notifications
You must be signed in to change notification settings - Fork 1
container.linked list
load container.linked-list
This module provides the Container.LinkedList class which store objects with a constant insertion or removal time.
This class creates a linked list which stores a liste of values and provides an iterator-based access as well as constant time insertions and removals.
For most purposes, Container.List is the is the right class to use. If you need a real linked list, with guarantees of constant time insertions in the middle of the list and iterators to items rather than indexes, use Container.LinkedList.
| Modifiers | Member | Description |
|---|---|---|
class |
Node | This class store the context of a node of a Container.LinkedList.Node.Contain... |
const |
append | Inserts value at the end of the list. |
const |
clear | Removes all the elements of the list. |
const |
contains | Returns true if the list contains value; otherwise returns false. |
const |
count | Returns the number of occurrences of value in the list. |
const |
data | Returns an array containing each elements of the list. |
const |
delete | Cleans up the list instance. |
const |
each | Apply the func function to each elements of the list. |
const |
first | Returns the first element of the list. If the list is empty, none is returned. |
const |
firstNode | Returns the first node of the list. If the list is empty, none is returned. |
const |
in | Returns an iterator on the elements of the list. |
const |
insertAfter | Inserts a new node storing the given value after the given node. |
const |
insertBefore | Inserts a new node storing the given value before the given node. |
const |
isEmpty | Returns true if the list is empty; otherwise returns false. |
const |
last | Returns the last element of the list. If the list is empty, none is returned. |
const |
lastNode | Returns the last node of the list. If the list is empty, none is returned. |
const |
moveAfter | Moves the from node after the to node. |
const |
moveBefore | Moves the from node before the to node. |
const |
new | Creates a new instance of Container.LinkedList.Container.LinkedList. If values... |
const |
nodeOf | Returns the node of the first occurrence of value in the list, searching forw... |
const |
prepend | Inserts value at the beginning of the list. |
const |
remove | Removes the node element of the list and returns the next node. |
const |
removeAll | Removes all the occurences of value in the list. |
const |
removeFirst | Removes the first element of the list. |
const |
removeLast | Removes the last element of the list. |
const |
removeOne | Removes the first occurence of value in the list. |
const |
replace | Replaces the node with a new node storing the given value. |
const |
size | Returns the number of elements in the list. |
const |
toArray | Converts the list to an array. |
| Modifiers | Member | Description |
|---|---|---|
class |
Data | Internal root element data structure. |
final |
root | Root element data. |
Internal root element data structure.
| Modifiers | Member | Description |
|---|---|---|
| back | Last element of the list. | |
| front | First element of the list. |
This class store the context of a node of a Container.LinkedList. It can be retrieved with Container.LinkedList.firstNode or Container.LinkedList.lastNode.
| Modifiers | Member | Description |
|---|---|---|
const |
getNext | Returns the next node. If self is the last node, none is returned. |
const |
getPrevious | Returns the previous node. If self is the first node, none is returned. |
const |
getValue | Returns the value of the node. |
const |
insertNext | Inserts a next node. |
const |
insertPrevious | Inserts a previous node. |
const |
new | Creates a new node storing value into the list context. |
const |
remove | Removes the node. |
const |
replace | Replaces the node. |
| Modifiers | Member | Description |
|---|---|---|
final |
list | List element data |
final |
next | Next node in the list |
final |
prev | Previous node in the list |
final |
value | Node value |
null
Last element of the list.
null
First element of the list.
def (const self)
Returns the next node. If self is the last node, none is
returned.
def (const self)
Returns the previous node. If self is the first node, none is
returned.
def (const self)
Returns the value of the node.
def (self, node)
Inserts a next node.
def (self, node)
Inserts a previous node.
null
List element data
def (self, list, value)
Creates a new node storing value into the list context.
null
Next node in the list
null
Previous node in the list
def (self)
Removes the node.
def (self, node)
Replaces the node.
none
Node value
def (self, value)
Inserts value at the end of the list.
def (self)
Removes all the elements of the list.
def (const self, value)
Returns true if the list contains value; otherwise returns false.
def (const self, value)
Returns the number of occurrences of value in the list.
def (const self)
Returns an array containing each elements of the list.
def (self)
Cleans up the list instance.
def (const self, func)
Apply the func function to each elements of the list.
def (const self)
Returns the first element of the list. If the list is empty, none is
returned.
def (const self)
Returns the first node of the list. If the list is empty, none is
returned.
def (const self)
Returns an iterator on the elements of the list.
def (const self, const value)
Returns true if the list contains value; otherwise returns false.
def (self, node, value)
Inserts a new node storing the given value after the given node.
def (self, node, value)
Inserts a new node storing the given value before the given node.
def (const self)
Returns true if the list is empty; otherwise returns false.
def (const self)
Returns the last element of the list. If the list is empty, none is
returned.
def (const self)
Returns the last node of the list. If the list is empty, none is
returned.
def (self, from, to)
Moves the from node after the to node.
def (self, from, to)
Moves the from node before the to node.
def (self, values = [])
Creates a new instance of Container.LinkedList. If values is given,
the list will be initialized with the given values.
def (const self, value, from = none)
Returns the node of the first occurrence of value in the list,
searching forward from node from if given or from the list beginning.
Returns none if no element matched.
def (self, value)
Inserts value at the beginning of the list.
def (self, node)
Removes the node element of the list and returns the next node.
def (self, value)
Removes all the occurences of value in the list.
def (self)
Removes the first element of the list.
def (self)
Removes the last element of the list.
def (self, value)
Removes the first occurence of value in the list.
def (self, node, value)
Replaces the node with a new node storing the given value.
null
Root element data.
def (const self)
Returns the number of elements in the list.
def (const self)
Converts the list to an array.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules