Documentation ¶
Index ¶
- type Element
- type List
- func (x *List[T]) Back() T
- func (x *List[T]) Begin() *Element
- func (x *List[T]) Erase(e *Element) *Element
- func (x *List[T]) Find(v T) *Element
- func (x *List[T]) FindBy(v T, start *Element) *Element
- func (x *List[T]) FindByFunc(v T, start *Element, eq func(T, T) bool) *Element
- func (x *List[T]) FindFunc(v T, eq func(T, T) bool) *Element
- func (x *List[T]) Front() T
- func (x *List[T]) GetValue(e *Element) T
- func (x *List[T]) Index(i int) *Element
- func (x *List[T]) Index2(i int, j int) (*Element, *Element)
- func (x *List[T]) InsertAfter(v T, mark *Element) *Element
- func (x *List[T]) InsertBefore(v T, mark *Element) *Element
- func (x *List[T]) Len() int
- func (x *List[T]) Less(i, j int) bool
- func (x *List[T]) MoveAfter(e, mark *Element)
- func (x *List[T]) MoveBefore(e, mark *Element)
- func (x *List[T]) MoveToBack(e *Element)
- func (x *List[T]) MoveToFront(e *Element)
- func (x *List[T]) PopBack() T
- func (x *List[T]) PopFront() T
- func (x *List[T]) PushBack(v T) *Element
- func (x *List[T]) PushBackList(other *List[T])
- func (x *List[T]) PushBackMuch(v ...T)
- func (x *List[T]) PushFront(v T) *Element
- func (x *List[T]) PushFrontList(other *List[T])
- func (x *List[T]) PushFrontMuch(v ...T)
- func (x *List[T]) Remove(v T) bool
- func (x *List[T]) RemoveAll(v T) int
- func (x *List[T]) RemoveAllFunc(v T, eq func(T, T) bool) int
- func (x *List[T]) RemoveFunc(v T, eq func(T, T) bool) bool
- func (x *List[T]) RemoveMuch(v T, c int) int
- func (x *List[T]) RemoveMuchFunc(v T, c int, eq func(T, T) bool) int
- func (x *List[T]) ReverseBegin() *Element
- func (x *List[T]) Sort()
- func (x *List[T]) Swap(i, j int)
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 }
func (*List[T]) FindByFunc ¶
func (*List[T]) InsertAfter ¶
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*List[T]) InsertBefore ¶
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*List[T]) MoveAfter ¶
MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*List[T]) MoveBefore ¶
MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*List[T]) MoveToBack ¶
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*List[T]) MoveToFront ¶
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*List[T]) PushBack ¶
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*List[T]) PushBackList ¶
PushBackList inserts a copy of another list at the back of list l. The lists l and other may be the same. They must not be nil.
func (*List[T]) PushBackMuch ¶
func (x *List[T]) PushBackMuch(v ...T)
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*List[T]) PushFront ¶
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*List[T]) PushFrontList ¶
PushFrontList inserts a copy of another list at the front of list l. The lists l and other may be the same. They must not be nil.
func (*List[T]) PushFrontMuch ¶
func (x *List[T]) PushFrontMuch(v ...T)