v0.0.0-...-1047d84 Latest Latest

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

Go to latest
Published: Oct 21, 2019 License: ISC Imports: 2 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type List

type List struct {
	Values []interface{}
	// contains filtered or unexported fields

List Data structure representing a single instance of a list.

func New

func New(cap int) *List

New Create a new instance of a List and return a reference to it.

func (*List) Add

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

Add Add a value to list and return the index we stored it at. If list is full, log it as a warning.

func (*List) Clear

func (list *List) Clear()

Clear Clears the receiver List

func (*List) Get

func (list *List) Get(idx int) interface{}

Get Returns the value at the specified index in list.

func (*List) HasNext

func (list *List) HasNext() bool

HasNext Returns true if there is another value after the current one in the list.

func (*List) Next

func (list *List) Next() interface{}

Next Returns the next value in the list.

func (*List) Previous

func (list *List) Previous() interface{}

Previous Returns the previous value in the list.

func (*List) Remove

func (list *List) Remove(index int) bool

Remove Remove a value from the specified `list`, by its index. Returns true if removed the value at index, otherwise returns false.

func (*List) ResetIterator

func (list *List) ResetIterator()

ResetIterator Returns the previous value in the list.

func (*List) Size

func (list *List) Size() (total int)

Size Returns the number of non-nil elements in the list's backing slice.

Jump to

Keyboard shortcuts

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