Documentation ¶
Overview ¶
Package internallist implements an internal doubly linked list.
To iterate over a list (where l is a *List):
for e := l.Front(); e != nil; e = e.Next() { // do something with e.Value }
Index ¶
- type Element
- type List
- func (l *List) Back() *Element
- func (l *List) Front() *Element
- func (l *List) Init() *List
- func (l *List) InsertAfter(e *Element, mark *Element) *Element
- func (l *List) InsertBefore(e *Element, mark *Element) *Element
- func (l *List) Len() int
- func (l *List) MoveAfter(e, mark *Element)
- func (l *List) MoveBefore(e, mark *Element)
- func (l *List) MoveToBack(e *Element)
- func (l *List) MoveToFront(e *Element)
- func (l *List) PushBack(e *Element) *Element
- func (l *List) PushFront(e *Element) *Element
- func (l *List) Remove(e *Element) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct { // The value stored with this element. Value interface{} // contains filtered or unexported fields }
Element is an element of a linked list. It should be internally embedded into the target structure, and have Value initialised
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents an internal doubly linked list. The zero value for List is an empty list ready to use.
func (*List) InsertAfter ¶
InsertAfter inserts a new element e after mark and returns e. If mark is not an element of l, the list is not modified.
func (*List) InsertBefore ¶
InsertBefore inserts a new element e before mark and returns e. If mark is not an element of l, the list is not modified.
func (*List) 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.
func (*List) 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.
func (*List) MoveToBack ¶
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified.
func (*List) MoveToFront ¶
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified.