Documentation
¶
Overview ¶
Package xlist contains extensions to the standard library package container/list.
Index ¶
- type List
- func (l *List[T]) Back() *Node[T]
- func (l *List[T]) Clear()
- func (l *List[T]) Front() *Node[T]
- func (l *List[T]) InsertAfter(value T, mark *Node[T]) *Node[T]
- func (l *List[T]) InsertBefore(value T, mark *Node[T]) *Node[T]
- func (l *List[T]) Len() int
- func (l *List[T]) MoveAfter(node *Node[T], mark *Node[T])
- func (l *List[T]) MoveBefore(node *Node[T], mark *Node[T])
- func (l *List[T]) MoveToBack(node *Node[T])
- func (l *List[T]) MoveToFront(node *Node[T])
- func (l *List[T]) PushBack(value T) *Node[T]
- func (l *List[T]) PushFront(value T) *Node[T]
- func (l *List[T]) Remove(node *Node[T])
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List is a doubly-linked list.
func (*List[T]) InsertAfter ¶
InsertBefore adds a new node with the given value after the node mark.
func (*List[T]) InsertBefore ¶
InsertBefore adds a new node with the given value before the node mark.
func (*List[T]) MoveAfter ¶
MoveAfter moves node just after mark. Afterwards, mark.Next() == node && node.Prev() == mark.
func (*List[T]) MoveBefore ¶
MoveBefore moves node just before mark. Afterwards, mark.Prev() == node && node.Next() == mark.
func (*List[T]) MoveToBack ¶
MoveToFront moves node to the back of the list.
func (*List[T]) MoveToFront ¶
MoveToFront moves node to the front of the list.
Click to show internal directories.
Click to hide internal directories.