maps

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2020 newtbig Author. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 newtbig Author. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 newtbig Author. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(value interface{}) string

Types

type IMap

type IMap interface {
	containers.Container
}

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

func (*Iterator) Begin

func (this *Iterator) Begin()

func (*Iterator) End

func (this *Iterator) End()

func (*Iterator) First

func (this *Iterator) First() bool

func (*Iterator) Key

func (this *Iterator) Key() interface{}

func (*Iterator) Last

func (this *Iterator) Last() bool

func (*Iterator) Next

func (this *Iterator) Next() bool

func (*Iterator) Prev

func (this *Iterator) Prev() bool

func (*Iterator) Value

func (this *Iterator) Value() interface{}

type Map

type Map struct {
	Root *Node

	Comparator containers.Comparator
	// contains filtered or unexported fields
}

func NewWith

func NewWith(comparator containers.Comparator) *Map

func NewWithIntComparator

func NewWithIntComparator() *Map

func NewWithStringComparator

func NewWithStringComparator() *Map

func NewWithUInt32Comparator

func NewWithUInt32Comparator() *Map

func (*Map) Ceiling

func (this *Map) Ceiling(key interface{}) (ceiling *Node, found bool)

func (*Map) Clear

func (this *Map) Clear()

func (*Map) Empty

func (this *Map) Empty() bool

func (*Map) Floor

func (this *Map) Floor(key interface{}) (floor *Node, found bool)

func (*Map) FromJSON

func (tree *Map) FromJSON(data []byte) error

func (*Map) Get

func (this *Map) Get(key interface{}) (value interface{}, found bool)

func (*Map) Iterator

func (this *Map) Iterator() Iterator

func (*Map) Keys

func (this *Map) Keys() []interface{}

func (*Map) Left

func (this *Map) Left() *Node

func (*Map) Put

func (this *Map) Put(key interface{}, value interface{})

func (*Map) Remove

func (this *Map) Remove(key interface{})

func (*Map) Right

func (this *Map) Right() *Node

func (*Map) Size

func (this *Map) Size() int

func (*Map) String

func (this *Map) String() string

func (*Map) ToJSON

func (tree *Map) ToJSON() ([]byte, error)

func (*Map) Values

func (this *Map) Values() []interface{}

type Node

type Node struct {
	Key   interface{}
	Value interface{}

	Left   *Node
	Right  *Node
	Parent *Node
	// contains filtered or unexported fields
}

func (*Node) String

func (node *Node) String() string

Jump to

Keyboard shortcuts

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