container: github.com/zc310/container/list Index | Files

package list

import "github.com/zc310/container/list"

Index

Package Files

list.go

type List Uses

type List struct {
    // contains filtered or unexported fields
}

List very useful general purpose list container

func New Uses

func New() *List

New returns an initialized list.

func (*List) Add Uses

func (p *List) Add(v interface{}) int

Add Add an item to the list

func (*List) Clear Uses

func (p *List) Clear()

Clear Removes all list items, setting the Count to 0

func (List) Count Uses

func (p List) Count() int

Count The number of items in the list

func (*List) Delete Uses

func (p *List) Delete(i int)

Delete Removes an item from the list by its list position

func (List) Empty Uses

func (p List) Empty() bool

Empty If an empty list

func (*List) First Uses

func (p *List) First() (interface{}, bool)

First Gets the first item in the list

func (List) Get Uses

func (p List) Get(i int) (interface{}, bool)

Get Gets an item from the list by its list positiont

func (*List) Grow Uses

func (p *List) Grow(n int)

Grow Used to set the size (number object pointers) of the list

func (*List) IndexOf Uses

func (p *List) IndexOf(v interface{}) int

IndexOf Gives the list position of a specified object in the list

func (*List) Insert Uses

func (p *List) Insert(i int, v interface{})

Insert Inserts a new item into the list at a given index position

func (*List) Last Uses

func (p *List) Last() (interface{}, bool)

Last Gets the last item in the list

func (*List) Put Uses

func (p *List) Put(i int, v interface{}) bool

Put Set a new item into the list at a given index position

func (*List) Remove Uses

func (p *List) Remove(v interface{}) int

Remove Removes an item from the list by its object

func (*List) String Uses

func (p *List) String() string

func (*List) Swap Uses

func (p *List) Swap(a, b int)

Swap Moves an item to a new list position

Package list imports 2 packages (graph). Updated 2017-08-13. Refresh now. Tools for package owners.