container

package module
v0.0.0-...-875e463 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2015 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryTree

type BinaryTree struct {
	Head *BinaryTreeNode
	// contains filtered or unexported fields
}

func NewBinaryTree

func NewBinaryTree(compare Compare) *BinaryTree

func (*BinaryTree) Add

func (tree *BinaryTree) Add(element interface{}) error

func (*BinaryTree) Contains

func (tree *BinaryTree) Contains(element interface{}) bool

func (*BinaryTree) Get

func (tree *BinaryTree) Get(element interface{}) (interface{}, error)

func (*BinaryTree) Left

func (tree *BinaryTree) Left() (interface{}, error)

func (*BinaryTree) Remove

func (tree *BinaryTree) Remove(element interface{}) error

func (*BinaryTree) Right

func (tree *BinaryTree) Right() (interface{}, error)

func (*BinaryTree) SetCompareFunc

func (tree *BinaryTree) SetCompareFunc(compare Compare)

func (*BinaryTree) Size

func (tree *BinaryTree) Size() int

func (*BinaryTree) ToArray

func (tree *BinaryTree) ToArray() []interface{}

func (*BinaryTree) ToArrayOfType

func (tree *BinaryTree) ToArrayOfType(elementType reflect.Type) interface{}

func (*BinaryTree) Visit

func (tree *BinaryTree) Visit(trait func(element interface{}, i int))

type BinaryTreeNode

type BinaryTreeNode struct {
	Element     interface{}
	Left, Right *BinaryTreeNode
}

func NewBinaryTreeNode

func NewBinaryTreeNode(element interface{}) *BinaryTreeNode

type Compare

type Compare func(interface{}, interface{}) int

type Container

type Container interface {
	Contains(interface{}) bool
	Add(interface{}) error
	Get(interface{}) (interface{}, error)
	Remove(interface{}) error
	Size() int
	ToArray() []interface{}
	ToArrayOfType(reflect.Type) interface{}
	Visit(func(interface{}, int))
}

type KeyValue

type KeyValue struct {
	Key   interface{}
	Value interface{}
}

type LimitedBinaryTree

type LimitedBinaryTree struct {
	BinaryTree
	Limit       int
	PreserveMin bool
}

func NewLimitedBinaryTree

func NewLimitedBinaryTree(compare Compare, limit int, preserveMin bool) *LimitedBinaryTree

func (*LimitedBinaryTree) Add

func (tree *LimitedBinaryTree) Add(element interface{}) error

type LinkedList

type LinkedList struct {
	Head *LinkedListItem
	// contains filtered or unexported fields
}

func NewLinkedList

func NewLinkedList() *LinkedList

func (*LinkedList) Add

func (list *LinkedList) Add(element interface{}) error

func (*LinkedList) Contains

func (list *LinkedList) Contains(element interface{}) bool

func (*LinkedList) Get

func (list *LinkedList) Get(elementId interface{}) (interface{}, error)

func (*LinkedList) Remove

func (list *LinkedList) Remove(elementId interface{}) error

func (*LinkedList) Size

func (list *LinkedList) Size() int

func (*LinkedList) ToArray

func (list *LinkedList) ToArray() []interface{}

func (*LinkedList) ToArrayOfType

func (list *LinkedList) ToArrayOfType(elementType reflect.Type) interface{}

func (*LinkedList) Visit

func (list *LinkedList) Visit(trait func(element interface{}, i int))

type LinkedListItem

type LinkedListItem struct {
	Element interface{}
	Next    *LinkedListItem
}

type Map

type Map struct {
	Map map[interface{}]interface{}
	// contains filtered or unexported fields
}

func NewMap

func NewMap() *Map

func (*Map) Add

func (m *Map) Add(keyValue interface{}) error

func (*Map) Contains

func (m *Map) Contains(key interface{}) bool

func (*Map) Get

func (m *Map) Get(key interface{}) (interface{}, error)

func (*Map) Remove

func (m *Map) Remove(key interface{}) error

func (*Map) Size

func (m *Map) Size() int

func (*Map) ToArray

func (m *Map) ToArray() []interface{}

func (*Map) ToArrayOfType

func (m *Map) ToArrayOfType(elementType reflect.Type) interface{}

func (*Map) Visit

func (m *Map) Visit(trait func(element interface{}, i int))

type Set

type Set struct {
	Map map[interface{}]bool
	// contains filtered or unexported fields
}

func NewSet

func NewSet() *Set

func (*Set) Add

func (s *Set) Add(element interface{}) error

func (*Set) Contains

func (s *Set) Contains(element interface{}) bool

func (*Set) Get

func (s *Set) Get(element interface{}) (interface{}, error)

func (*Set) Remove

func (s *Set) Remove(element interface{}) error

func (*Set) Size

func (s *Set) Size() int

func (*Set) ToArray

func (s *Set) ToArray() []interface{}

func (*Set) ToArrayOfType

func (s *Set) ToArrayOfType(elementType reflect.Type) interface{}

func (*Set) Visit

func (s *Set) Visit(trait func(element interface{}, i int))

Jump to

Keyboard shortcuts

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