DoublyLinkedListItem
public class DoublyLinkedListItem<Element> where Element : Equatable
Individual Node of the DoublyLinkedList
-
Previous node
Declaration
Swift
private(set) public var prev: DoublyLinkedListItem<Element>? { get }
-
Next node
Declaration
Swift
private(set) public var next: DoublyLinkedListItem<Element>? { get }
-
Value of the node
Declaration
Swift
private(set) public var element: Element { get }
-
Creates Node for
DoublyLinkedList
with provided parametersDeclaration
Swift
public init(prev: DoublyLinkedListItem?, next: DoublyLinkedListItem?, element: Element)
Parameters
prev
Previous node from this node
next
Next node from this node
element
Value of this node
-
Updates the previous node item to the provided node
Declaration
Swift
public func updatePreviousElement(pointerTo newPrev: DoublyLinkedListItem<Element>?)
Parameters
newPrev
New previous node, which will be replacing existing
-
Updates the next node item to the provided node
Declaration
Swift
public func updateNextElement(pointerTo newNext: DoublyLinkedListItem<Element>?)
Parameters
newNext
New next node, which will be replacing existing