treeset

package
v0.0.0-...-4257bbb Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2015 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

func NewWith

func NewWith(comparator utils.Comparator) *Set

Instantiates a new empty set with the custom comparator.

func NewWithIntComparator

func NewWithIntComparator() *Set

Instantiates a new empty set with the IntComparator, i.e. keys are of type int.

func NewWithStringComparator

func NewWithStringComparator() *Set

Instantiates a new empty set with the StringComparator, i.e. keys are of type string.

func (*Set) Add

func (set *Set) Add(items ...interface{})

Adds the items (one or more) to the set.

func (*Set) Clear

func (set *Set) Clear()

Clears all values in the set.

func (*Set) Contains

func (set *Set) Contains(items ...interface{}) bool

Check wether items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*Set) Empty

func (set *Set) Empty() bool

Returns true if set does not contain any elements.

func (*Set) Remove

func (set *Set) Remove(items ...interface{})

Removes the items (one or more) from the set.

func (*Set) Size

func (set *Set) Size() int

Returns number of elements within the set.

func (*Set) String

func (set *Set) String() string

func (*Set) Values

func (set *Set) Values() []interface{}

Returns all items in the set.

Jump to

Keyboard shortcuts

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