Documentation
¶
Index ¶
- type HashSet
- func NewHashSet[E comparable]() HashSet[E]
- func NewHashSetFromCollection[E comparable](s collection.Collection[E]) HashSet[E]
- func NewHashSetFromSlice[E comparable](slice []E) HashSet[E]
- func NewHashSetFromStream[E comparable](stream stream.Stream) HashSet[E]
- func NewHashSetWithSize[E comparable](size int) HashSet[E]
- func (h HashSet[E]) Add(e E) bool
- func (h HashSet[E]) AddAll(other collection.Collection[E]) bool
- func (h HashSet[E]) AsSlice() []E
- func (h HashSet[E]) Clear()
- func (h HashSet[E]) Contains(e E) bool
- func (h HashSet[E]) ContainsAll(other collection.Collection[E]) bool
- func (h HashSet[E]) ForEach(consumer func(e E))
- func (h HashSet[E]) ForEachIndexed(consumer func(index int, e E) (stop bool))
- func (h HashSet[E]) IsEmpty() bool
- func (h HashSet[E]) MarshalJSON() ([]byte, error)
- func (h HashSet[E]) Remove(e E) (found bool)
- func (h HashSet[E]) RemoveAll(other collection.Collection[E]) bool
- func (h HashSet[E]) RemoveIf(predicate func(e E) bool)
- func (h HashSet[E]) RetainAll(other collection.Collection[E])
- func (h HashSet[E]) Size() int
- func (h HashSet[E]) Stream() stream.Stream
- func (h HashSet[E]) String() string
- func (h HashSet[E]) UnmarshalJSON(bytes []byte) error
- type LinkedHashSet
- func NewLinkedHashSet[E comparable]() LinkedHashSet[E]
- func NewLinkedHashSetFromCollection[E comparable](c collection.Collection[E]) LinkedHashSet[E]
- func NewLinkedHashSetFromSlice[E comparable](slice []E) LinkedHashSet[E]
- func NewLinkedHashSetFromStream[E comparable](stream stream.Stream) LinkedHashSet[E]
- func NewLinkedHashSetWithSize[E comparable](size int) LinkedHashSet[E]
- func (lhs *LinkedHashSet[E]) Add(e E) bool
- func (lhs *LinkedHashSet[E]) AddAll(other collection.Collection[E]) bool
- func (lhs *LinkedHashSet[E]) AsSlice() []E
- func (lhs *LinkedHashSet[E]) Clear()
- func (lhs *LinkedHashSet[E]) Contains(e E) bool
- func (lhs *LinkedHashSet[E]) ContainsAll(other collection.Collection[E]) bool
- func (lhs *LinkedHashSet[E]) ForEach(consumer func(e E))
- func (lhs *LinkedHashSet[E]) ForEachIndexed(consumer func(index int, e E) (stop bool))
- func (lhs *LinkedHashSet[E]) IsEmpty() bool
- func (lhs *LinkedHashSet[E]) MarshalJSON() ([]byte, error)
- func (lhs *LinkedHashSet[E]) Remove(e E) (found bool)
- func (lhs *LinkedHashSet[E]) RemoveAll(other collection.Collection[E]) bool
- func (lhs *LinkedHashSet[E]) RemoveIf(predicate func(e E) bool)
- func (lhs *LinkedHashSet[E]) RetainAll(other collection.Collection[E])
- func (lhs *LinkedHashSet[E]) Size() int
- func (lhs *LinkedHashSet[E]) Stream() stream.Stream
- func (lhs *LinkedHashSet[E]) String() string
- func (lhs *LinkedHashSet[E]) UnmarshalJSON(bytes []byte) error
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashSet ¶
type HashSet[E comparable] map[E]struct{}
func NewHashSet ¶
func NewHashSet[E comparable]() HashSet[E]
func NewHashSetFromCollection ¶
func NewHashSetFromCollection[E comparable](s collection.Collection[E]) HashSet[E]
func NewHashSetFromSlice ¶
func NewHashSetFromSlice[E comparable](slice []E) HashSet[E]
func NewHashSetFromStream ¶
func NewHashSetFromStream[E comparable](stream stream.Stream) HashSet[E]
func NewHashSetWithSize ¶
func NewHashSetWithSize[E comparable](size int) HashSet[E]
func (HashSet[E]) AddAll ¶
func (h HashSet[E]) AddAll(other collection.Collection[E]) bool
func (HashSet[E]) ContainsAll ¶
func (h HashSet[E]) ContainsAll(other collection.Collection[E]) bool
func (HashSet[E]) ForEachIndexed ¶
func (HashSet[E]) MarshalJSON ¶
func (HashSet[E]) RemoveAll ¶
func (h HashSet[E]) RemoveAll(other collection.Collection[E]) bool
func (HashSet[E]) RetainAll ¶
func (h HashSet[E]) RetainAll(other collection.Collection[E])
func (HashSet[E]) UnmarshalJSON ¶
type LinkedHashSet ¶
type LinkedHashSet[E comparable] struct { // contains filtered or unexported fields }
func NewLinkedHashSet ¶
func NewLinkedHashSet[E comparable]() LinkedHashSet[E]
func NewLinkedHashSetFromCollection ¶
func NewLinkedHashSetFromCollection[E comparable](c collection.Collection[E]) LinkedHashSet[E]
func NewLinkedHashSetFromSlice ¶
func NewLinkedHashSetFromSlice[E comparable](slice []E) LinkedHashSet[E]
func NewLinkedHashSetFromStream ¶
func NewLinkedHashSetFromStream[E comparable](stream stream.Stream) LinkedHashSet[E]
func NewLinkedHashSetWithSize ¶
func NewLinkedHashSetWithSize[E comparable](size int) LinkedHashSet[E]
func (*LinkedHashSet[E]) Add ¶
func (lhs *LinkedHashSet[E]) Add(e E) bool
func (*LinkedHashSet[E]) AddAll ¶
func (lhs *LinkedHashSet[E]) AddAll(other collection.Collection[E]) bool
func (*LinkedHashSet[E]) AsSlice ¶
func (lhs *LinkedHashSet[E]) AsSlice() []E
func (*LinkedHashSet[E]) Clear ¶
func (lhs *LinkedHashSet[E]) Clear()
func (*LinkedHashSet[E]) Contains ¶
func (lhs *LinkedHashSet[E]) Contains(e E) bool
func (*LinkedHashSet[E]) ContainsAll ¶
func (lhs *LinkedHashSet[E]) ContainsAll(other collection.Collection[E]) bool
func (*LinkedHashSet[E]) ForEach ¶
func (lhs *LinkedHashSet[E]) ForEach(consumer func(e E))
func (*LinkedHashSet[E]) ForEachIndexed ¶
func (lhs *LinkedHashSet[E]) ForEachIndexed(consumer func(index int, e E) (stop bool))
func (*LinkedHashSet[E]) IsEmpty ¶
func (lhs *LinkedHashSet[E]) IsEmpty() bool
func (*LinkedHashSet[E]) MarshalJSON ¶
func (lhs *LinkedHashSet[E]) MarshalJSON() ([]byte, error)
func (*LinkedHashSet[E]) Remove ¶
func (lhs *LinkedHashSet[E]) Remove(e E) (found bool)
func (*LinkedHashSet[E]) RemoveAll ¶
func (lhs *LinkedHashSet[E]) RemoveAll(other collection.Collection[E]) bool
func (*LinkedHashSet[E]) RemoveIf ¶
func (lhs *LinkedHashSet[E]) RemoveIf(predicate func(e E) bool)
func (*LinkedHashSet[E]) RetainAll ¶
func (lhs *LinkedHashSet[E]) RetainAll(other collection.Collection[E])
func (*LinkedHashSet[E]) Size ¶
func (lhs *LinkedHashSet[E]) Size() int
func (*LinkedHashSet[E]) Stream ¶
func (lhs *LinkedHashSet[E]) Stream() stream.Stream
func (*LinkedHashSet[E]) String ¶
func (lhs *LinkedHashSet[E]) String() string
func (*LinkedHashSet[E]) UnmarshalJSON ¶
func (lhs *LinkedHashSet[E]) UnmarshalJSON(bytes []byte) error
type Set ¶
type Set[E comparable] interface { collection.Collection[E] // Add adds an element to the set. Add(e E) bool // AddAll adds all elements from the set to the set. AddAll(other collection.Collection[E]) bool // Remove removes an element from the set. Remove(e E) (found bool) // RemoveAll removes all elements from the set. RemoveAll(other collection.Collection[E]) bool // RemoveIf removes all elements that satisfy the predicate. RemoveIf(predicate func(e E) bool) // RetainAll retains only the elements in the set that are contained in the specified set. RetainAll(other collection.Collection[E]) // Clear removes all elements from the set. Clear() // Contains returns true if the set contains the element. Contains(e E) bool // ContainsAll returns true if the set contains all elements in the specified set. ContainsAll(other collection.Collection[E]) bool // IsEmpty returns true if the set is empty. IsEmpty() bool // Size returns the number of elements in the set. Size() int // ForEach iterates over all elements in the set. ForEach(consumer func(e E)) // ForEachIndexed iterates over all elements in the set. // The consumer function returns true to stop iterating. ForEachIndexed(consumer func(index int, e E) (stop bool)) // AsSlice returns the set as a slice. AsSlice() []E // Stream returns a stream of the elements in the set. Stream() stream.Stream }
Click to show internal directories.
Click to hide internal directories.