sortedlinkedlist

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: GPL-3.0 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 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 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 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) 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) 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