sortedlinkedlist

package
v0.0.0-...-c9d2d86 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(element IElement)

Add Add element

func Clear

func Clear()

Clear Initialize

func IsExist

func IsExist(element IElement) bool

IsExist elemeng if exist

func Iter

func Iter() func() IElement

Iter Iter, not thread safe

func IterElement

func IterElement(function func(element IElement) bool)

IterElement Iter, thread safe

func Len

func Len() int

Len Len of elements

func Remove

func Remove(element IElement)

Remove Remove element

func RemoveFront

func RemoveFront()

RemoveFront remove front

func Removes

func Removes(elements []IElement)

Removes Remove element

Types

type IElement

type IElement interface {
	Compare(v interface{}) int
	Serialize() []byte
}

IElement interface for element of sortedLinkedList

func GetIElementByKey

func GetIElementByKey(key string) IElement

GetIElementByKey get element

func RemoveAll

func RemoveAll() (elements []IElement)

RemoveAll Remove all elements

func RemoveBefore

func RemoveBefore(element IElement) (elements []IElement)

RemoveBefore Remove elements before element

type SortedLinkedList

type SortedLinkedList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SortedLinkedList Define sortedLinkedList struct

func NewSortedLinkedList

func NewSortedLinkedList() *SortedLinkedList

NewSortedLinkedList Create sortedLinkedList instance

func (*SortedLinkedList) Add

func (sll *SortedLinkedList) Add(element IElement)

Add Add element

func (*SortedLinkedList) Clear

func (sll *SortedLinkedList) Clear()

Clear Initialize

func (*SortedLinkedList) GetIElementByKey

func (sll *SortedLinkedList) GetIElementByKey(key string) IElement

GetIElementByKey get element

func (*SortedLinkedList) IsExist

func (sll *SortedLinkedList) IsExist(element IElement) bool

IsExist elemeng if exist

func (*SortedLinkedList) Iter

func (sll *SortedLinkedList) Iter() func() IElement

Iter Iter, not thread safe

func (*SortedLinkedList) IterElement

func (sll *SortedLinkedList) IterElement(function func(element IElement) bool)

IterElement Iter, thread safe

func (*SortedLinkedList) Len

func (sll *SortedLinkedList) Len() int

Len Len of elements

func (*SortedLinkedList) Remove

func (sll *SortedLinkedList) Remove(element IElement)

Remove Remove element

func (*SortedLinkedList) RemoveAll

func (sll *SortedLinkedList) RemoveAll() (elements []IElement)

RemoveAll Remove all elements

func (*SortedLinkedList) RemoveBefore

func (sll *SortedLinkedList) RemoveBefore(element IElement) (elements []IElement)

RemoveBefore Remove elements before element

func (*SortedLinkedList) RemoveFront

func (sll *SortedLinkedList) RemoveFront() IElement

RemoveFront remove front

func (*SortedLinkedList) Removes

func (sll *SortedLinkedList) Removes(elements []IElement)

Removes Remove element

Jump to

Keyboard shortcuts

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