Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deque ¶
type Deque[E any] interface { // Len returns the number of elements of Deque. // The complexity is O(1). Len() int // Clear clears Deque Clear() // Iter call fn on all elements which after the offset, stopped if false returned Iter(offset int, fn func(E) bool) // Front returns the first element of Deque, false if the list is empty. Front() (*Element[E], bool) // PopFront removes and returns the first element of Deque PopFront() *Element[E] // Front returns the first element of Deque, panic if the list is empty. MustFront() *Element[E] // Back returns the last element of Deque, false if the list is empty. Back() (*Element[E], bool) // PopBack removes and returns the last element of Deque PopBack() *Element[E] // MustBack returns the last element of Deque, panic if the list is empty. MustBack() *Element[E] // PushFront inserts a new element e with value v at the front of deque. PushFront(v E) *Element[E] // PushBack inserts a new element e with value v at the back of deque. PushBack(v E) *Element[E] // 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. InsertBefore(v E, mark *Element[E]) *Element[E] // 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. InsertAfter(v E, mark *Element[E]) *Element[E] // 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. MoveToFront(e *Element[E]) // 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. MoveToBack(e *Element[E]) // 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. MoveBefore(e, mark *Element[E]) // 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. MoveAfter(e, mark *Element[E]) // Remove removes e from l if e is an element of list l. // It returns the element value e.Value. // The element must not be nil. Remove(e *Element[E]) E // Truncate trancate deque, keeping the first size elements Truncate(keeping int) // Drain removes the specified range in the deque, returns drained Drain(from, to int) Deque[E] }
Deque deque
Click to show internal directories.
Click to hide internal directories.