list

package
v0.0.0-...-f01ed60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

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

List very useful general purpose list container

func New

func New() *List

New returns an initialized list.

func (*List) Add

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

Add Add an item to the list

func (*List) Clear

func (p *List) Clear()

Clear Removes all list items, setting the Count to 0

func (List) Count

func (p List) Count() int

Count The number of items in the list

func (*List) Delete

func (p *List) Delete(i int)

Delete Removes an item from the list by its list position

func (List) Empty

func (p List) Empty() bool

Empty If an empty list

func (*List) First

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

First Gets the first item in the list

func (List) Get

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

Get Gets an item from the list by its list positiont

func (*List) Grow

func (p *List) Grow(n int)

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

func (*List) IndexOf

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

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

func (*List) Insert

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

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

func (*List) Last

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

Last Gets the last item in the list

func (*List) Put

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

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

Remove Removes an item from the list by its object

func (*List) String

func (p *List) String() string

func (*List) Swap

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

Swap Moves an item to a new list position

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL