package collections

import "github.com/dotcloud/docker/pkg/collections"

Index

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.

Source Files

orderedintset.go

Version
v0.8.0
Published
Feb 5, 2014
Platform
js/wasm
Imports
1 packages
Last checked
2 minutes ago

Tools for package owners.