Documentation ¶
Index ¶
- type Item
- type ItemElement
- type ItemList
- func (l *ItemList) Back() *ItemElement
- func (l *ItemList) Front() *ItemElement
- func (l *ItemList) Init() *ItemList
- func (l *ItemList) InsertAfter(v Item, mark *ItemElement) *ItemElement
- func (l *ItemList) InsertBefore(v Item, mark *ItemElement) *ItemElement
- func (l *ItemList) Len() int
- func (l *ItemList) MoveAfter(e, mark *ItemElement)
- func (l *ItemList) MoveBefore(e, mark *ItemElement)
- func (l *ItemList) MoveToBack(e *ItemElement)
- func (l *ItemList) MoveToFront(e *ItemElement)
- func (l *ItemList) PushBack(v Item) *ItemElement
- func (l *ItemList) PushBackList(other *ItemList)
- func (l *ItemList) PushFront(v Item) *ItemElement
- func (l *ItemList) PushFrontList(other *ItemList)
- func (l *ItemList) Remove(e *ItemElement) Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemElement ¶
type ItemElement struct { // The value stored with this element. Value Item // contains filtered or unexported fields }
ItemElement is an element of a linked list.
func (*ItemElement) Next ¶
func (e *ItemElement) Next() *ItemElement
Next returns the next list element or nil.
func (*ItemElement) Prev ¶
func (e *ItemElement) Prev() *ItemElement
Prev returns the previous list element or nil.
type ItemList ¶
type ItemList struct {
// contains filtered or unexported fields
}
ItemList is a linked list of Items.
func (*ItemList) Back ¶
func (l *ItemList) Back() *ItemElement
Back returns the last element of list l or nil if the list is empty.
func (*ItemList) Front ¶
func (l *ItemList) Front() *ItemElement
Front returns the first element of list l or nil if the list is empty.
func (*ItemList) InsertAfter ¶
func (l *ItemList) InsertAfter(v Item, mark *ItemElement) *ItemElement
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 (*ItemList) InsertBefore ¶
func (l *ItemList) InsertBefore(v Item, mark *ItemElement) *ItemElement
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 (*ItemList) MoveAfter ¶
func (l *ItemList) MoveAfter(e, mark *ItemElement)
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 (*ItemList) MoveBefore ¶
func (l *ItemList) MoveBefore(e, mark *ItemElement)
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 (*ItemList) MoveToBack ¶
func (l *ItemList) MoveToBack(e *ItemElement)
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 (*ItemList) MoveToFront ¶
func (l *ItemList) MoveToFront(e *ItemElement)
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 (*ItemList) PushBack ¶
func (l *ItemList) PushBack(v Item) *ItemElement
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*ItemList) PushBackList ¶
PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.
func (*ItemList) PushFront ¶
func (l *ItemList) PushFront(v Item) *ItemElement
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*ItemList) PushFrontList ¶
PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.
func (*ItemList) Remove ¶
func (l *ItemList) Remove(e *ItemElement) Item
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.