xlist

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 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 interface {

	// PushBack push value in tail
	//  @param o value
	PushBack(o interface{})

	// PushFront push value in head
	//  @param o value
	PushFront(o interface{})

	// Remove remove an element
	//  @param o value
	Remove(o interface{})

	// Front get head element
	//  @return interface{}
	Front() interface{}

	// Back get tail element
	//  @return interface{}
	Back() interface{}

	// PopFront pop head element
	//  @return interface{}
	PopFront() interface{}

	// PopBack pop tail element
	//  @return interface{}
	PopBack() interface{}

	// Len calc list length
	//  @return int
	Len() int

	// Foreach The function that accepts polling returns true to continue polling and false to terminate polling
	//  @param f function
	Foreach(f func(interface{}) bool)

	// Find find element in list
	//  @param i element
	//  @return bool exist => true, not exist => false
	Find(i interface{}) bool
}

type SimpleList

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

func NewSimpleList

func NewSimpleList() *SimpleList

func (*SimpleList) Back

func (l *SimpleList) Back() interface{}

Back Tail element (the last element), if nil is not returned

@receiver l
@return interface{}

func (*SimpleList) Find

func (l *SimpleList) Find(i interface{}) bool

Find Query whether there is a parameter object in the linked list

@receiver l list
@param i elemnt
@return bool success is true, fail is false

func (*SimpleList) Foreach

func (l *SimpleList) Foreach(f func(interface{}) bool)

Foreach

@receiver l
@param f The function that accepts polling returns true to continue polling and false to terminate polling

func (*SimpleList) Front

func (l *SimpleList) Front() interface{}

Front First element (first element), if nil is not returned

@receiver l list
@return interface{}

func (*SimpleList) Len

func (l *SimpleList) Len() int

Len get list length

@receiver l list
@return int list length

func (*SimpleList) PopBack

func (l *SimpleList) PopBack() interface{}

PopBack Get the tail element and remove it, if nil is not returned

@receiver l list
@return interface{}

func (*SimpleList) PopFront

func (l *SimpleList) PopFront() interface{}

PopFront Get the first element and remove it, if nil is not returned

@receiver l list
@return interface{}

func (*SimpleList) PushBack

func (l *SimpleList) PushBack(o interface{})

PushBack add an element at the end of the linked list

@receiver l list
@param o element

func (*SimpleList) PushFront

func (l *SimpleList) PushFront(o interface{})

PushFront Add an element at the head of the linked list

@receiver l list
@param o element

func (*SimpleList) Remove

func (l *SimpleList) Remove(o interface{})

Remove remove element in list

@receiver l list
@param o element

Jump to

Keyboard shortcuts

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