set

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 2 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
}

take advantage of map

func New

func New() *Set

Create a new set

func Of

func Of(es ...interface{}) *Set

Of returns an unmodifiable set containing the input element(s).

func (*Set) Add

func (s *Set) Add(e interface{}) *Set

Add adds the specified element to this set if it is not already present.

func (*Set) AddAll

func (s *Set) AddAll(stream *slice.Stream) *Set

AddAll adds all of the elements in the specified collection to this set if they're not already present (optional operation).

func (*Set) AddAllOrdered

func (s *Set) AddAllOrdered(stream *slice.Stream) *Set

AddAll adds all of the elements in the specified collection to this set if they're not already present (optional operation). <p>This operation processes the elements one at a time, in encounter order if one exists. Performing the action for one element performing the action for subsequent elements, but for any given element, the action may be performed in whatever thread the library chooses.

func (*Set) Clear

func (s *Set) Clear() *Set

Clear removes all of the elements from this set (optional operation). The set will be empty after this call returns.

func (*Set) Clone

func (s *Set) Clone() *Set

Clone returns a deepcopy of it's self

func (*Set) Contains

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

Contains returns {@code true} if this set contains the specified element.

func (*Set) ContainsAll

func (s *Set) ContainsAll(stream *slice.Stream) bool

ContainsAll returns {@code true} {@code true} if this set contains all of the elements of the specified collection.

func (*Set) Count

func (s *Set) Count() int

Count returns the number of elements in this set (its cardinality).

func (*Set) Equals

func (s *Set) Equals(other *Set) bool

Compares the specified object with this set for equality. Returns {@code true} if the specified object is also a set, the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set).

func (*Set) Init

func (s *Set) Init() *Set

func (*Set) IsEmpty

func (s *Set) IsEmpty() bool

IsEmpty returns {@code true} if this set contains no elements.

func (*Set) Length

func (s *Set) Length() int

func (*Set) Remove

func (s *Set) Remove(e interface{}) *Set

Remove removes the specified element from this set if it is present.

func (*Set) RemoveAll

func (s *Set) RemoveAll(stream *slice.Stream) *Set

RemoveAll removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the <i>asymmetric set difference</i> of the two sets.

func (*Set) RetainAll

func (s *Set) RetainAll(stream *slice.Stream) *Set

RetainAll retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection.

func (*Set) Size

func (s *Set) Size() int

grammar surger for count

func (*Set) ToSlice

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

ToSLice returns a slice containing all of the elements in this set.

func (*Set) ToStream

func (s *Set) ToStream() *slice.Stream

Jump to

Keyboard shortcuts

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