This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Object - cache : LinkedList

The cache:LinkedList object consists operations of LinkedList data structure which are related to LRU eviction algorithm

Methods

Adds a node to the end of the provided linked list.

Adds a node to the start of the provided linked list.

Removes a node from the provided linked list.

Removes the last node from the provided linked list.

Clears the provided linked list.

addLast

(Node node)

Adds a node to the end of the provided linked list.

Parameters

  • node Node
  • The node, which should be added to the provided linked list

addFirst

(Node node)

Adds a node to the start of the provided linked list.

Parameters

  • node Node
  • The node, which should be added to the provided linked list

remove

(Node node)

Removes a node from the provided linked list.

Parameters

  • node Node
  • The node, which should be removed from the provided linked list

removeLast

()

returns Node?

Removes the last node from the provided linked list.

  • Return Type

    (Node?)
  • Last node of the provided linked list or () if the last node is empty

clear

()

Clears the provided linked list.