Class: Node

Node

Double linked list implementation.

new Node(data, prev, next, callback)

Node constructor
Parameters:
Name Type Description
data Object Data which is stored in this node.
prev Node Previous node.
next Node Next node.
callback Node~reviverCallback Function to mutate {data} when a node is added.
Source:
node.js

Methods


getFirst(callback)

Return first node.
Parameters:
Name Type Description
callback Node~getFirstCallback .
Source:
node.js

addLast(data)

Add a new node next to the last node.
Parameters:
Name Type Description
data Object Node data to be stored.
Source:
node.js

addFirst(data)

Add a new node previous to first node.
Parameters:
Name Type Description
data Object Node data to be stored.
Source:
node.js

getLast(callback)

Return last node.
Parameters:
Name Type Description
callback Node~getLastCallback .
Source:
node.js

getData()

Return node data.
Source:
node.js
Returns:
data - Node data.
Type
Object

Type Definitions


reviverCallback(data, node)

Mapping callback
Parameters:
Name Type Description
data Data of Node.
node Node Node itself.
Source:
node.js

getLastCallback(node)

Last Node callback
Parameters:
Name Type Description
node Node Last node which contains the token and module.
Source:
node.js

getFirstCallback(node)

First Node callback
Parameters:
Name Type Description
node Node First node which contains the token and module.
Source:
node.js