collections

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2014 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderedIntSet

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

OrderedIntSet is a thread-safe sorted set and a stack.

func NewOrderedIntSet

func NewOrderedIntSet() *OrderedIntSet

NewOrderedSet returns an initialized OrderedSet

func (*OrderedIntSet) Exists

func (s *OrderedIntSet) Exists(elem int) bool

Exists checks if the given element present in the list.

func (*OrderedIntSet) Pop

func (s *OrderedIntSet) Pop() int

Pop is an alias to PopFront()

func (*OrderedIntSet) PopFront

func (s *OrderedIntSet) PopFront() int

Pop returns the first elemen from the list and removes it. If the list is empty, it returns 0

func (*OrderedIntSet) PullBack

func (s *OrderedIntSet) PullBack() int

PullBack retrieve the last element of the list. The element is not removed. If the list is empty, an empty element is returned.

func (*OrderedIntSet) Push

func (s *OrderedIntSet) Push(elem int)

Push takes a string and adds it to the set. If the elem aready exists, it has no effect.

func (*OrderedIntSet) Remove

func (s *OrderedIntSet) Remove(elem int)

Remove removes an element from the list. If the element is not found, it has no effect.

Jump to

Keyboard shortcuts

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