Documentation ¶
Index ¶
- type Set
- func (s *Set) Add(e interface{}) *Set
- func (s *Set) AddAll(stream *slice.Stream) *Set
- func (s *Set) AddAllOrdered(stream *slice.Stream) *Set
- func (s *Set) Clear() *Set
- func (s *Set) Clone() *Set
- func (s *Set) Contains(e interface{}) bool
- func (s *Set) ContainsAll(stream *slice.Stream) bool
- func (s *Set) Count() int
- func (s *Set) Equals(other *Set) bool
- func (s *Set) Init() *Set
- func (s *Set) IsEmpty() bool
- func (s *Set) Length() int
- func (s *Set) Remove(e interface{}) *Set
- func (s *Set) RemoveAll(stream *slice.Stream) *Set
- func (s *Set) RetainAll(stream *slice.Stream) *Set
- func (s *Set) Size() int
- func (s *Set) ToSlice() []interface{}
- func (s *Set) ToStream() *slice.Stream
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 Of ¶
func Of(es ...interface{}) *Set
Of returns an unmodifiable set containing the input element(s).
func (*Set) AddAll ¶
AddAll adds all of the elements in the specified collection to this set if they're not already present (optional operation).
func (*Set) AddAllOrdered ¶
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 ¶
Clear removes all of the elements from this set (optional operation). The set will be empty after this call returns.
func (*Set) ContainsAll ¶
ContainsAll returns {@code true} {@code true} if this set contains all of the elements of the specified collection.
func (*Set) Equals ¶
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) RemoveAll ¶
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 ¶
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.