Documentation ¶
Overview ¶
package shared provides shareable collection types for core Go built-in types. These are safe for sharing across multiple goroutines because they lock access using mutexes. However, take care because any sequence of multiple operations will not be atomic.
Index ¶
- type AnyCollection
- type AnyList
- func (list *AnyList) Add(more ...interface{})
- func (list *AnyList) Append(more ...interface{}) *AnyList
- func (list *AnyList) Clear()
- func (list *AnyList) Clone() *AnyList
- func (list *AnyList) Contains(v interface{}) bool
- func (list *AnyList) ContainsAll(i ...interface{}) bool
- func (list *AnyList) CountBy(p func(interface{}) bool) (result int)
- func (list *AnyList) DistinctBy(equal func(interface{}, interface{}) bool) *AnyList
- func (list *AnyList) DoDeleteAt(index, n int) *AnyList
- func (list *AnyList) DoDeleteFirst(n int) *AnyList
- func (list *AnyList) DoDeleteLast(n int) *AnyList
- func (list *AnyList) DoInsertAt(index int, more ...interface{}) *AnyList
- func (list *AnyList) DoKeepWhere(p func(interface{}) bool) *AnyList
- func (list *AnyList) DoReverse() *AnyList
- func (list *AnyList) DoShuffle() *AnyList
- func (list *AnyList) Drop(n int) *AnyList
- func (list *AnyList) DropLast(n int) *AnyList
- func (list *AnyList) DropWhile(p func(interface{}) bool) *AnyList
- func (list *AnyList) Equals(other *AnyList) bool
- func (list *AnyList) Exists(p func(interface{}) bool) bool
- func (list *AnyList) Filter(p func(interface{}) bool) *AnyList
- func (list *AnyList) Find(p func(interface{}) bool) (interface{}, bool)
- func (list *AnyList) FlatMap(f func(interface{}) []interface{}) *AnyList
- func (list *AnyList) Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{}
- func (list *AnyList) Forall(p func(interface{}) bool) bool
- func (list *AnyList) Foreach(f func(interface{}))
- func (list *AnyList) Get(i int) interface{}
- func (list *AnyList) GobDecode(b []byte) error
- func (list AnyList) GobEncode() ([]byte, error)
- func (list *AnyList) Head() interface{}
- func (list *AnyList) HeadOption() (interface{}, bool)
- func (list *AnyList) IndexWhere(p func(interface{}) bool) int
- func (list *AnyList) IndexWhere2(p func(interface{}) bool, from int) int
- func (list *AnyList) Init() *AnyList
- func (list *AnyList) IsEmpty() bool
- func (list *AnyList) IsSequence() bool
- func (list *AnyList) IsSet() bool
- func (list *AnyList) Last() interface{}
- func (list *AnyList) LastIndexWhere(p func(interface{}) bool) int
- func (list *AnyList) LastIndexWhere2(p func(interface{}) bool, before int) int
- func (list *AnyList) LastOption() (interface{}, bool)
- func (list *AnyList) Len() int
- func (list *AnyList) Map(f func(interface{}) interface{}) *AnyList
- func (list AnyList) MarshalJSON() ([]byte, error)
- func (list *AnyList) MaxBy(less func(interface{}, interface{}) bool) interface{}
- func (list *AnyList) MinBy(less func(interface{}, interface{}) bool) interface{}
- func (list *AnyList) MkString(sep string) string
- func (list *AnyList) MkString3(before, between, after string) string
- func (list *AnyList) NonEmpty() bool
- func (list *AnyList) Partition(p func(interface{}) bool) (*AnyList, *AnyList)
- func (list *AnyList) Reverse() *AnyList
- func (list *AnyList) Send() <-chan interface{}
- func (list *AnyList) Shuffle() *AnyList
- func (list *AnyList) Size() int
- func (list *AnyList) SortBy(less func(i, j interface{}) bool) *AnyList
- func (list *AnyList) StableSortBy(less func(i, j interface{}) bool) *AnyList
- func (list *AnyList) String() string
- func (list *AnyList) StringList() []string
- func (list *AnyList) Swap(i, j int)
- func (list *AnyList) Tail() *AnyList
- func (list *AnyList) Take(n int) *AnyList
- func (list *AnyList) TakeLast(n int) *AnyList
- func (list *AnyList) TakeWhile(p func(interface{}) bool) *AnyList
- func (list *AnyList) ToInterfaceSlice() []interface{}
- func (list *AnyList) ToList() *AnyList
- func (list *AnyList) ToSet() *AnySet
- func (list *AnyList) ToSlice() []interface{}
- func (list *AnyList) UnmarshalJSON(b []byte) error
- type AnyMkStringer
- type AnyQueue
- func (queue *AnyQueue) Add(more ...interface{})
- func (queue *AnyQueue) Cap() int
- func (queue *AnyQueue) Clear()
- func (queue *AnyQueue) Clone() *AnyQueue
- func (queue *AnyQueue) Contains(v interface{}) bool
- func (queue *AnyQueue) ContainsAll(i ...interface{}) bool
- func (queue *AnyQueue) CountBy(p func(interface{}) bool) (result int)
- func (queue *AnyQueue) DoKeepWhere(p func(interface{}) bool) *AnyQueue
- func (queue *AnyQueue) Equals(other *AnyQueue) bool
- func (queue *AnyQueue) Exists(p func(interface{}) bool) bool
- func (queue *AnyQueue) Filter(p func(interface{}) bool) *AnyQueue
- func (queue *AnyQueue) Find(p func(interface{}) bool) (interface{}, bool)
- func (queue *AnyQueue) FlatMap(f func(interface{}) []interface{}) *AnyQueue
- func (queue *AnyQueue) Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{}
- func (queue *AnyQueue) Forall(p func(interface{}) bool) bool
- func (queue *AnyQueue) Foreach(f func(interface{}))
- func (queue *AnyQueue) Get(i int) interface{}
- func (queue *AnyQueue) Head() interface{}
- func (queue *AnyQueue) HeadOption() (interface{}, bool)
- func (queue *AnyQueue) IsEmpty() bool
- func (queue *AnyQueue) IsFull() bool
- func (queue *AnyQueue) IsOverwriting() bool
- func (queue *AnyQueue) IsSequence() bool
- func (queue *AnyQueue) IsSet() bool
- func (queue *AnyQueue) Last() interface{}
- func (queue *AnyQueue) LastOption() (interface{}, bool)
- func (queue *AnyQueue) Len() int
- func (queue *AnyQueue) Less(i, j int) bool
- func (queue *AnyQueue) Map(f func(interface{}) interface{}) *AnyQueue
- func (queue AnyQueue) MarshalJSON() ([]byte, error)
- func (queue *AnyQueue) MaxBy(less func(interface{}, interface{}) bool) interface{}
- func (queue *AnyQueue) MinBy(less func(interface{}, interface{}) bool) interface{}
- func (queue *AnyQueue) MkString(sep string) string
- func (queue *AnyQueue) MkString3(before, between, after string) string
- func (queue *AnyQueue) NonEmpty() bool
- func (queue *AnyQueue) Offer(items ...interface{}) []interface{}
- func (queue *AnyQueue) Partition(p func(interface{}) bool) (*AnyQueue, *AnyQueue)
- func (queue *AnyQueue) Pop(n int) []interface{}
- func (queue *AnyQueue) Pop1() (interface{}, bool)
- func (queue *AnyQueue) Push(items ...interface{}) *AnyQueue
- func (queue *AnyQueue) Reallocate(capacity int, overwrite bool) *AnyQueue
- func (queue *AnyQueue) Send() <-chan interface{}
- func (queue *AnyQueue) Size() int
- func (queue *AnyQueue) Sort()
- func (queue *AnyQueue) Space() int
- func (queue *AnyQueue) StableSort()
- func (queue *AnyQueue) String() string
- func (queue *AnyQueue) StringList() []string
- func (queue *AnyQueue) Swap(i, j int)
- func (queue *AnyQueue) ToInterfaceSlice() []interface{}
- func (queue *AnyQueue) ToList() *AnyList
- func (queue *AnyQueue) ToSet() *AnySet
- func (queue *AnyQueue) ToSlice() []interface{}
- func (queue *AnyQueue) UnmarshalJSON(b []byte) error
- type AnySequence
- type AnySet
- func (set *AnySet) Add(more ...interface{})
- func (set *AnySet) Cardinality() int
- func (set *AnySet) Clear()
- func (set *AnySet) Clone() *AnySet
- func (set *AnySet) Contains(i interface{}) bool
- func (set *AnySet) ContainsAll(i ...interface{}) bool
- func (set *AnySet) CountBy(p func(interface{}) bool) (result int)
- func (set *AnySet) Difference(other *AnySet) *AnySet
- func (set *AnySet) Equals(other *AnySet) bool
- func (set *AnySet) Exists(p func(interface{}) bool) bool
- func (set *AnySet) Filter(p func(interface{}) bool) *AnySet
- func (set *AnySet) Find(p func(interface{}) bool) (interface{}, bool)
- func (set *AnySet) FlatMap(f func(interface{}) []interface{}) *AnySet
- func (set *AnySet) Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{}
- func (set *AnySet) Forall(p func(interface{}) bool) bool
- func (set *AnySet) Foreach(f func(interface{}))
- func (set *AnySet) GobDecode(b []byte) error
- func (set AnySet) GobEncode() ([]byte, error)
- func (set *AnySet) Intersect(other *AnySet) *AnySet
- func (set *AnySet) IsEmpty() bool
- func (set *AnySet) IsSequence() bool
- func (set *AnySet) IsSet() bool
- func (set *AnySet) IsSubset(other *AnySet) bool
- func (set *AnySet) IsSuperset(other *AnySet) bool
- func (set *AnySet) Map(f func(interface{}) interface{}) *AnySet
- func (set *AnySet) MarshalJSON() ([]byte, error)
- func (set *AnySet) MaxBy(less func(interface{}, interface{}) bool) interface{}
- func (set *AnySet) MinBy(less func(interface{}, interface{}) bool) interface{}
- func (set *AnySet) MkString(sep string) string
- func (set *AnySet) MkString3(before, between, after string) string
- func (set *AnySet) NonEmpty() bool
- func (set *AnySet) Partition(p func(interface{}) bool) (*AnySet, *AnySet)
- func (set *AnySet) Remove(i interface{})
- func (set *AnySet) Send() <-chan interface{}
- func (set *AnySet) Size() int
- func (set *AnySet) String() string
- func (set *AnySet) StringList() []string
- func (set *AnySet) StringMap() map[string]bool
- func (set *AnySet) SymmetricDifference(other *AnySet) *AnySet
- func (set *AnySet) ToInterfaceSlice() []interface{}
- func (set *AnySet) ToList() *AnyList
- func (set *AnySet) ToSet() *AnySet
- func (set *AnySet) ToSlice() []interface{}
- func (set *AnySet) Union(other *AnySet) *AnySet
- func (set *AnySet) UnmarshalJSON(b []byte) error
- type AnySizer
- type Int64Collection
- type Int64Int64Map
- func (mm *Int64Int64Map) Clear()
- func (mm *Int64Int64Map) Clone() *Int64Int64Map
- func (mm *Int64Int64Map) ContainsAllKeys(kk ...int64) bool
- func (mm *Int64Int64Map) ContainsKey(k int64) bool
- func (mm *Int64Int64Map) DropWhere(fn func(int64, int64) bool) Int64Int64Tuples
- func (mm *Int64Int64Map) Equals(other *Int64Int64Map) bool
- func (mm *Int64Int64Map) Exists(p func(int64, int64) bool) bool
- func (mm *Int64Int64Map) Filter(p func(int64, int64) bool) *Int64Int64Map
- func (mm *Int64Int64Map) Find(p func(int64, int64) bool) (Int64Int64Tuple, bool)
- func (mm *Int64Int64Map) FlatMap(f func(int64, int64) []Int64Int64Tuple) *Int64Int64Map
- func (mm *Int64Int64Map) Forall(p func(int64, int64) bool) bool
- func (mm *Int64Int64Map) Foreach(f func(int64, int64))
- func (mm *Int64Int64Map) Get(k int64) (int64, bool)
- func (mm *Int64Int64Map) GobDecode(b []byte) error
- func (mm *Int64Int64Map) GobEncode() ([]byte, error)
- func (mm *Int64Int64Map) IsEmpty() bool
- func (mm *Int64Int64Map) Keys() collection.Int64List
- func (mm *Int64Int64Map) Map(f func(int64, int64) (int64, int64)) *Int64Int64Map
- func (mm *Int64Int64Map) MkString(sep string) string
- func (mm *Int64Int64Map) MkString4(before, between, after, equals string) string
- func (mm *Int64Int64Map) NonEmpty() bool
- func (mm *Int64Int64Map) OrderedSlice(keys collection.Int64List) Int64Int64Tuples
- func (mm *Int64Int64Map) Partition(p func(int64, int64) bool) (matching *Int64Int64Map, others *Int64Int64Map)
- func (mm *Int64Int64Map) Pop(k int64) (int64, bool)
- func (mm *Int64Int64Map) Put(k int64, v int64) bool
- func (mm *Int64Int64Map) Remove(k int64)
- func (mm *Int64Int64Map) Size() int
- func (mm *Int64Int64Map) String() string
- func (mm *Int64Int64Map) ToSlice() Int64Int64Tuples
- func (mm *Int64Int64Map) Values() collection.Int64List
- type Int64Int64Tuple
- type Int64Int64Tuples
- func (ts Int64Int64Tuples) Append1(k int64, v int64) Int64Int64Tuples
- func (ts Int64Int64Tuples) Append2(k1 int64, v1 int64, k2 int64, v2 int64) Int64Int64Tuples
- func (ts Int64Int64Tuples) Append3(k1 int64, v1 int64, k2 int64, v2 int64, k3 int64, v3 int64) Int64Int64Tuples
- func (ts Int64Int64Tuples) MkString(sep string) string
- func (ts Int64Int64Tuples) MkString4(before, between, after, equals string) string
- func (ts Int64Int64Tuples) String() string
- func (ts Int64Int64Tuples) ToMap() *Int64Int64Map
- func (ts Int64Int64Tuples) Values(values ...int64) Int64Int64Tuples
- type Int64List
- func (list *Int64List) Add(more ...int64)
- func (list *Int64List) Append(more ...int64) *Int64List
- func (list *Int64List) Clear()
- func (list *Int64List) Clone() *Int64List
- func (list *Int64List) Contains(v int64) bool
- func (list *Int64List) ContainsAll(i ...int64) bool
- func (list *Int64List) CountBy(p func(int64) bool) (result int)
- func (list *Int64List) DistinctBy(equal func(int64, int64) bool) *Int64List
- func (list *Int64List) DoDeleteAt(index, n int) *Int64List
- func (list *Int64List) DoDeleteFirst(n int) *Int64List
- func (list *Int64List) DoDeleteLast(n int) *Int64List
- func (list *Int64List) DoInsertAt(index int, more ...int64) *Int64List
- func (list *Int64List) DoKeepWhere(p func(int64) bool) *Int64List
- func (list *Int64List) DoReverse() *Int64List
- func (list *Int64List) DoShuffle() *Int64List
- func (list *Int64List) Drop(n int) *Int64List
- func (list *Int64List) DropLast(n int) *Int64List
- func (list *Int64List) DropWhile(p func(int64) bool) *Int64List
- func (list *Int64List) Equals(other *Int64List) bool
- func (list *Int64List) Exists(p func(int64) bool) bool
- func (list *Int64List) Filter(p func(int64) bool) *Int64List
- func (list *Int64List) Find(p func(int64) bool) (int64, bool)
- func (list *Int64List) FlatMap(f func(int64) []int64) *Int64List
- func (list *Int64List) FlatMapToString(f func(int64) []string) []string
- func (list *Int64List) Fold(initial int64, fn func(int64, int64) int64) int64
- func (list *Int64List) Forall(p func(int64) bool) bool
- func (list *Int64List) Foreach(f func(int64))
- func (list *Int64List) Get(i int) int64
- func (list *Int64List) GobDecode(b []byte) error
- func (list Int64List) GobEncode() ([]byte, error)
- func (list *Int64List) Head() int64
- func (list *Int64List) HeadOption() (int64, bool)
- func (list *Int64List) IndexWhere(p func(int64) bool) int
- func (list *Int64List) IndexWhere2(p func(int64) bool, from int) int
- func (list *Int64List) Init() *Int64List
- func (list *Int64List) IsEmpty() bool
- func (list *Int64List) IsSequence() bool
- func (list *Int64List) IsSet() bool
- func (list *Int64List) Last() int64
- func (list *Int64List) LastIndexWhere(p func(int64) bool) int
- func (list *Int64List) LastIndexWhere2(p func(int64) bool, before int) int
- func (list *Int64List) LastOption() (int64, bool)
- func (list *Int64List) Len() int
- func (list *Int64List) Map(f func(int64) int64) *Int64List
- func (list *Int64List) MapToString(f func(int64) string) []string
- func (list Int64List) MarshalJSON() ([]byte, error)
- func (list *Int64List) Max() (result int64)
- func (list *Int64List) MaxBy(less func(int64, int64) bool) int64
- func (list *Int64List) Min() int64
- func (list *Int64List) MinBy(less func(int64, int64) bool) int64
- func (list *Int64List) MkString(sep string) string
- func (list *Int64List) MkString3(before, between, after string) string
- func (list *Int64List) NonEmpty() bool
- func (list *Int64List) Partition(p func(int64) bool) (*Int64List, *Int64List)
- func (list *Int64List) Reverse() *Int64List
- func (list *Int64List) Send() <-chan int64
- func (list *Int64List) Shuffle() *Int64List
- func (list *Int64List) Size() int
- func (list *Int64List) SortBy(less func(i, j int64) bool) *Int64List
- func (list *Int64List) Sorted() *Int64List
- func (list *Int64List) StableSortBy(less func(i, j int64) bool) *Int64List
- func (list *Int64List) StableSorted() *Int64List
- func (list *Int64List) String() string
- func (list *Int64List) StringList() []string
- func (list *Int64List) Sum() int64
- func (list *Int64List) Swap(i, j int)
- func (list *Int64List) Tail() *Int64List
- func (list *Int64List) Take(n int) *Int64List
- func (list *Int64List) TakeLast(n int) *Int64List
- func (list *Int64List) TakeWhile(p func(int64) bool) *Int64List
- func (list *Int64List) ToInterfaceSlice() []interface{}
- func (list *Int64List) ToList() *Int64List
- func (list *Int64List) ToSet() *Int64Set
- func (list *Int64List) ToSlice() []int64
- func (list *Int64List) UnmarshalJSON(b []byte) error
- type Int64MkStringer
- type Int64Queue
- func (queue *Int64Queue) Add(more ...int64)
- func (queue *Int64Queue) Cap() int
- func (queue *Int64Queue) Clear()
- func (queue *Int64Queue) Clone() *Int64Queue
- func (queue *Int64Queue) Contains(v int64) bool
- func (queue *Int64Queue) ContainsAll(i ...int64) bool
- func (queue *Int64Queue) CountBy(p func(int64) bool) (result int)
- func (queue *Int64Queue) DoKeepWhere(p func(int64) bool) *Int64Queue
- func (queue *Int64Queue) Equals(other *Int64Queue) bool
- func (queue *Int64Queue) Exists(p func(int64) bool) bool
- func (queue *Int64Queue) Filter(p func(int64) bool) *Int64Queue
- func (queue *Int64Queue) Find(p func(int64) bool) (int64, bool)
- func (queue *Int64Queue) FlatMap(f func(int64) []int64) *Int64Queue
- func (queue *Int64Queue) FlatMapToString(f func(int64) []string) []string
- func (queue *Int64Queue) Fold(initial int64, fn func(int64, int64) int64) int64
- func (queue *Int64Queue) Forall(p func(int64) bool) bool
- func (queue *Int64Queue) Foreach(f func(int64))
- func (queue *Int64Queue) Get(i int) int64
- func (queue *Int64Queue) Head() int64
- func (queue *Int64Queue) HeadOption() (int64, bool)
- func (queue *Int64Queue) IsEmpty() bool
- func (queue *Int64Queue) IsFull() bool
- func (queue *Int64Queue) IsOverwriting() bool
- func (queue *Int64Queue) IsSequence() bool
- func (queue *Int64Queue) IsSet() bool
- func (queue *Int64Queue) Last() int64
- func (queue *Int64Queue) LastOption() (int64, bool)
- func (queue *Int64Queue) Len() int
- func (queue *Int64Queue) Less(i, j int) bool
- func (queue *Int64Queue) Map(f func(int64) int64) *Int64Queue
- func (queue *Int64Queue) MapToString(f func(int64) string) []string
- func (queue Int64Queue) MarshalJSON() ([]byte, error)
- func (queue *Int64Queue) Max() (result int64)
- func (queue *Int64Queue) MaxBy(less func(int64, int64) bool) int64
- func (queue *Int64Queue) Min() int64
- func (queue *Int64Queue) MinBy(less func(int64, int64) bool) int64
- func (queue *Int64Queue) MkString(sep string) string
- func (queue *Int64Queue) MkString3(before, between, after string) string
- func (queue *Int64Queue) NonEmpty() bool
- func (queue *Int64Queue) Offer(items ...int64) []int64
- func (queue *Int64Queue) Partition(p func(int64) bool) (*Int64Queue, *Int64Queue)
- func (queue *Int64Queue) Pop(n int) []int64
- func (queue *Int64Queue) Pop1() (int64, bool)
- func (queue *Int64Queue) Push(items ...int64) *Int64Queue
- func (queue *Int64Queue) Reallocate(capacity int, overwrite bool) *Int64Queue
- func (queue *Int64Queue) Send() <-chan int64
- func (queue *Int64Queue) Size() int
- func (queue *Int64Queue) Sort()
- func (queue *Int64Queue) Space() int
- func (queue *Int64Queue) StableSort()
- func (queue *Int64Queue) String() string
- func (queue *Int64Queue) StringList() []string
- func (queue *Int64Queue) Sum() int64
- func (queue *Int64Queue) Swap(i, j int)
- func (queue *Int64Queue) ToInterfaceSlice() []interface{}
- func (queue *Int64Queue) ToList() *Int64List
- func (queue *Int64Queue) ToSet() *Int64Set
- func (queue *Int64Queue) ToSlice() []int64
- func (queue *Int64Queue) UnmarshalJSON(b []byte) error
- type Int64Sequence
- type Int64Set
- func (set *Int64Set) Add(more ...int64)
- func (set *Int64Set) Cardinality() int
- func (set *Int64Set) Clear()
- func (set *Int64Set) Clone() *Int64Set
- func (set *Int64Set) Contains(i int64) bool
- func (set *Int64Set) ContainsAll(i ...int64) bool
- func (set *Int64Set) CountBy(p func(int64) bool) (result int)
- func (set *Int64Set) Difference(other *Int64Set) *Int64Set
- func (set *Int64Set) Equals(other *Int64Set) bool
- func (set *Int64Set) Exists(p func(int64) bool) bool
- func (set *Int64Set) Filter(p func(int64) bool) *Int64Set
- func (set *Int64Set) Find(p func(int64) bool) (int64, bool)
- func (set *Int64Set) FlatMap(f func(int64) []int64) *Int64Set
- func (set *Int64Set) FlatMapToString(f func(int64) []string) []string
- func (set *Int64Set) Fold(initial int64, fn func(int64, int64) int64) int64
- func (set *Int64Set) Forall(p func(int64) bool) bool
- func (set *Int64Set) Foreach(f func(int64))
- func (set *Int64Set) GobDecode(b []byte) error
- func (set Int64Set) GobEncode() ([]byte, error)
- func (set *Int64Set) Intersect(other *Int64Set) *Int64Set
- func (set *Int64Set) IsEmpty() bool
- func (set *Int64Set) IsSequence() bool
- func (set *Int64Set) IsSet() bool
- func (set *Int64Set) IsSubset(other *Int64Set) bool
- func (set *Int64Set) IsSuperset(other *Int64Set) bool
- func (set *Int64Set) Map(f func(int64) int64) *Int64Set
- func (set *Int64Set) MapToString(f func(int64) string) []string
- func (set *Int64Set) MarshalJSON() ([]byte, error)
- func (set *Int64Set) Max() (result int64)
- func (set *Int64Set) MaxBy(less func(int64, int64) bool) int64
- func (set *Int64Set) Min() int64
- func (set *Int64Set) MinBy(less func(int64, int64) bool) int64
- func (set *Int64Set) MkString(sep string) string
- func (set *Int64Set) MkString3(before, between, after string) string
- func (set *Int64Set) NonEmpty() bool
- func (set *Int64Set) Partition(p func(int64) bool) (*Int64Set, *Int64Set)
- func (set *Int64Set) Remove(i int64)
- func (set *Int64Set) Send() <-chan int64
- func (set *Int64Set) Size() int
- func (set *Int64Set) String() string
- func (set *Int64Set) StringList() []string
- func (set *Int64Set) StringMap() map[string]bool
- func (set *Int64Set) Sum() int64
- func (set *Int64Set) SymmetricDifference(other *Int64Set) *Int64Set
- func (set *Int64Set) ToInterfaceSlice() []interface{}
- func (set *Int64Set) ToList() *Int64List
- func (set *Int64Set) ToSet() *Int64Set
- func (set *Int64Set) ToSlice() []int64
- func (set *Int64Set) Union(other *Int64Set) *Int64Set
- func (set *Int64Set) UnmarshalJSON(b []byte) error
- type Int64Sizer
- type Int64StringMap
- func (mm *Int64StringMap) Clear()
- func (mm *Int64StringMap) Clone() *Int64StringMap
- func (mm *Int64StringMap) ContainsAllKeys(kk ...int64) bool
- func (mm *Int64StringMap) ContainsKey(k int64) bool
- func (mm *Int64StringMap) DropWhere(fn func(int64, string) bool) Int64StringTuples
- func (mm *Int64StringMap) Equals(other *Int64StringMap) bool
- func (mm *Int64StringMap) Exists(p func(int64, string) bool) bool
- func (mm *Int64StringMap) Filter(p func(int64, string) bool) *Int64StringMap
- func (mm *Int64StringMap) Find(p func(int64, string) bool) (Int64StringTuple, bool)
- func (mm *Int64StringMap) FlatMap(f func(int64, string) []Int64StringTuple) *Int64StringMap
- func (mm *Int64StringMap) Forall(p func(int64, string) bool) bool
- func (mm *Int64StringMap) Foreach(f func(int64, string))
- func (mm *Int64StringMap) Get(k int64) (string, bool)
- func (mm *Int64StringMap) GobDecode(b []byte) error
- func (mm *Int64StringMap) GobEncode() ([]byte, error)
- func (mm *Int64StringMap) IsEmpty() bool
- func (mm *Int64StringMap) Keys() collection.Int64List
- func (mm *Int64StringMap) Map(f func(int64, string) (int64, string)) *Int64StringMap
- func (mm *Int64StringMap) MkString(sep string) string
- func (mm *Int64StringMap) MkString4(before, between, after, equals string) string
- func (mm *Int64StringMap) NonEmpty() bool
- func (mm *Int64StringMap) OrderedSlice(keys collection.Int64List) Int64StringTuples
- func (mm *Int64StringMap) Partition(p func(int64, string) bool) (matching *Int64StringMap, others *Int64StringMap)
- func (mm *Int64StringMap) Pop(k int64) (string, bool)
- func (mm *Int64StringMap) Put(k int64, v string) bool
- func (mm *Int64StringMap) Remove(k int64)
- func (mm *Int64StringMap) Size() int
- func (mm *Int64StringMap) String() string
- func (mm *Int64StringMap) ToSlice() Int64StringTuples
- func (mm *Int64StringMap) Values() collection.StringList
- type Int64StringTuple
- type Int64StringTuples
- func (ts Int64StringTuples) Append1(k int64, v string) Int64StringTuples
- func (ts Int64StringTuples) Append2(k1 int64, v1 string, k2 int64, v2 string) Int64StringTuples
- func (ts Int64StringTuples) Append3(k1 int64, v1 string, k2 int64, v2 string, k3 int64, v3 string) Int64StringTuples
- func (ts Int64StringTuples) MkString(sep string) string
- func (ts Int64StringTuples) MkString4(before, between, after, equals string) string
- func (ts Int64StringTuples) String() string
- func (ts Int64StringTuples) ToMap() *Int64StringMap
- func (ts Int64StringTuples) Values(values ...string) Int64StringTuples
- type IntCollection
- type IntIntMap
- func (mm *IntIntMap) Clear()
- func (mm *IntIntMap) Clone() *IntIntMap
- func (mm *IntIntMap) ContainsAllKeys(kk ...int) bool
- func (mm *IntIntMap) ContainsKey(k int) bool
- func (mm *IntIntMap) DropWhere(fn func(int, int) bool) IntIntTuples
- func (mm *IntIntMap) Equals(other *IntIntMap) bool
- func (mm *IntIntMap) Exists(p func(int, int) bool) bool
- func (mm *IntIntMap) Filter(p func(int, int) bool) *IntIntMap
- func (mm *IntIntMap) Find(p func(int, int) bool) (IntIntTuple, bool)
- func (mm *IntIntMap) FlatMap(f func(int, int) []IntIntTuple) *IntIntMap
- func (mm *IntIntMap) Forall(p func(int, int) bool) bool
- func (mm *IntIntMap) Foreach(f func(int, int))
- func (mm *IntIntMap) Get(k int) (int, bool)
- func (mm *IntIntMap) GobDecode(b []byte) error
- func (mm *IntIntMap) GobEncode() ([]byte, error)
- func (mm *IntIntMap) IsEmpty() bool
- func (mm *IntIntMap) Keys() collection.IntList
- func (mm *IntIntMap) Map(f func(int, int) (int, int)) *IntIntMap
- func (mm *IntIntMap) MkString(sep string) string
- func (mm *IntIntMap) MkString4(before, between, after, equals string) string
- func (mm *IntIntMap) NonEmpty() bool
- func (mm *IntIntMap) OrderedSlice(keys collection.IntList) IntIntTuples
- func (mm *IntIntMap) Partition(p func(int, int) bool) (matching *IntIntMap, others *IntIntMap)
- func (mm *IntIntMap) Pop(k int) (int, bool)
- func (mm *IntIntMap) Put(k int, v int) bool
- func (mm *IntIntMap) Remove(k int)
- func (mm *IntIntMap) Size() int
- func (mm *IntIntMap) String() string
- func (mm *IntIntMap) ToSlice() IntIntTuples
- func (mm *IntIntMap) Values() collection.IntList
- type IntIntTuple
- type IntIntTuples
- func (ts IntIntTuples) Append1(k int, v int) IntIntTuples
- func (ts IntIntTuples) Append2(k1 int, v1 int, k2 int, v2 int) IntIntTuples
- func (ts IntIntTuples) Append3(k1 int, v1 int, k2 int, v2 int, k3 int, v3 int) IntIntTuples
- func (ts IntIntTuples) MkString(sep string) string
- func (ts IntIntTuples) MkString4(before, between, after, equals string) string
- func (ts IntIntTuples) String() string
- func (ts IntIntTuples) ToMap() *IntIntMap
- func (ts IntIntTuples) Values(values ...int) IntIntTuples
- type IntList
- func (list *IntList) Add(more ...int)
- func (list *IntList) Append(more ...int) *IntList
- func (list *IntList) Clear()
- func (list *IntList) Clone() *IntList
- func (list *IntList) Contains(v int) bool
- func (list *IntList) ContainsAll(i ...int) bool
- func (list *IntList) CountBy(p func(int) bool) (result int)
- func (list *IntList) DistinctBy(equal func(int, int) bool) *IntList
- func (list *IntList) DoDeleteAt(index, n int) *IntList
- func (list *IntList) DoDeleteFirst(n int) *IntList
- func (list *IntList) DoDeleteLast(n int) *IntList
- func (list *IntList) DoInsertAt(index int, more ...int) *IntList
- func (list *IntList) DoKeepWhere(p func(int) bool) *IntList
- func (list *IntList) DoReverse() *IntList
- func (list *IntList) DoShuffle() *IntList
- func (list *IntList) Drop(n int) *IntList
- func (list *IntList) DropLast(n int) *IntList
- func (list *IntList) DropWhile(p func(int) bool) *IntList
- func (list *IntList) Equals(other *IntList) bool
- func (list *IntList) Exists(p func(int) bool) bool
- func (list *IntList) Filter(p func(int) bool) *IntList
- func (list *IntList) Find(p func(int) bool) (int, bool)
- func (list *IntList) FlatMap(f func(int) []int) *IntList
- func (list *IntList) FlatMapToString(f func(int) []string) []string
- func (list *IntList) Fold(initial int, fn func(int, int) int) int
- func (list *IntList) Forall(p func(int) bool) bool
- func (list *IntList) Foreach(f func(int))
- func (list *IntList) Get(i int) int
- func (list *IntList) GobDecode(b []byte) error
- func (list IntList) GobEncode() ([]byte, error)
- func (list *IntList) Head() int
- func (list *IntList) HeadOption() (int, bool)
- func (list *IntList) IndexWhere(p func(int) bool) int
- func (list *IntList) IndexWhere2(p func(int) bool, from int) int
- func (list *IntList) Init() *IntList
- func (list *IntList) IsEmpty() bool
- func (list *IntList) IsSequence() bool
- func (list *IntList) IsSet() bool
- func (list *IntList) Last() int
- func (list *IntList) LastIndexWhere(p func(int) bool) int
- func (list *IntList) LastIndexWhere2(p func(int) bool, before int) int
- func (list *IntList) LastOption() (int, bool)
- func (list *IntList) Len() int
- func (list *IntList) Map(f func(int) int) *IntList
- func (list *IntList) MapToString(f func(int) string) []string
- func (list IntList) MarshalJSON() ([]byte, error)
- func (list *IntList) Max() (result int)
- func (list *IntList) MaxBy(less func(int, int) bool) int
- func (list *IntList) Min() int
- func (list *IntList) MinBy(less func(int, int) bool) int
- func (list *IntList) MkString(sep string) string
- func (list *IntList) MkString3(before, between, after string) string
- func (list *IntList) NonEmpty() bool
- func (list *IntList) Partition(p func(int) bool) (*IntList, *IntList)
- func (list *IntList) Reverse() *IntList
- func (list *IntList) Send() <-chan int
- func (list *IntList) Shuffle() *IntList
- func (list *IntList) Size() int
- func (list *IntList) SortBy(less func(i, j int) bool) *IntList
- func (list *IntList) Sorted() *IntList
- func (list *IntList) StableSortBy(less func(i, j int) bool) *IntList
- func (list *IntList) StableSorted() *IntList
- func (list *IntList) String() string
- func (list *IntList) StringList() []string
- func (list *IntList) Sum() int
- func (list *IntList) Swap(i, j int)
- func (list *IntList) Tail() *IntList
- func (list *IntList) Take(n int) *IntList
- func (list *IntList) TakeLast(n int) *IntList
- func (list *IntList) TakeWhile(p func(int) bool) *IntList
- func (list *IntList) ToInterfaceSlice() []interface{}
- func (list *IntList) ToList() *IntList
- func (list *IntList) ToSet() *IntSet
- func (list *IntList) ToSlice() []int
- func (list *IntList) UnmarshalJSON(b []byte) error
- type IntMkStringer
- type IntQueue
- func (queue *IntQueue) Add(more ...int)
- func (queue *IntQueue) Cap() int
- func (queue *IntQueue) Clear()
- func (queue *IntQueue) Clone() *IntQueue
- func (queue *IntQueue) Contains(v int) bool
- func (queue *IntQueue) ContainsAll(i ...int) bool
- func (queue *IntQueue) CountBy(p func(int) bool) (result int)
- func (queue *IntQueue) DoKeepWhere(p func(int) bool) *IntQueue
- func (queue *IntQueue) Equals(other *IntQueue) bool
- func (queue *IntQueue) Exists(p func(int) bool) bool
- func (queue *IntQueue) Filter(p func(int) bool) *IntQueue
- func (queue *IntQueue) Find(p func(int) bool) (int, bool)
- func (queue *IntQueue) FlatMap(f func(int) []int) *IntQueue
- func (queue *IntQueue) FlatMapToString(f func(int) []string) []string
- func (queue *IntQueue) Fold(initial int, fn func(int, int) int) int
- func (queue *IntQueue) Forall(p func(int) bool) bool
- func (queue *IntQueue) Foreach(f func(int))
- func (queue *IntQueue) Get(i int) int
- func (queue *IntQueue) Head() int
- func (queue *IntQueue) HeadOption() (int, bool)
- func (queue *IntQueue) IsEmpty() bool
- func (queue *IntQueue) IsFull() bool
- func (queue *IntQueue) IsOverwriting() bool
- func (queue *IntQueue) IsSequence() bool
- func (queue *IntQueue) IsSet() bool
- func (queue *IntQueue) Last() int
- func (queue *IntQueue) LastOption() (int, bool)
- func (queue *IntQueue) Len() int
- func (queue *IntQueue) Less(i, j int) bool
- func (queue *IntQueue) Map(f func(int) int) *IntQueue
- func (queue *IntQueue) MapToString(f func(int) string) []string
- func (queue IntQueue) MarshalJSON() ([]byte, error)
- func (queue *IntQueue) Max() (result int)
- func (queue *IntQueue) MaxBy(less func(int, int) bool) int
- func (queue *IntQueue) Min() int
- func (queue *IntQueue) MinBy(less func(int, int) bool) int
- func (queue *IntQueue) MkString(sep string) string
- func (queue *IntQueue) MkString3(before, between, after string) string
- func (queue *IntQueue) NonEmpty() bool
- func (queue *IntQueue) Offer(items ...int) []int
- func (queue *IntQueue) Partition(p func(int) bool) (*IntQueue, *IntQueue)
- func (queue *IntQueue) Pop(n int) []int
- func (queue *IntQueue) Pop1() (int, bool)
- func (queue *IntQueue) Push(items ...int) *IntQueue
- func (queue *IntQueue) Reallocate(capacity int, overwrite bool) *IntQueue
- func (queue *IntQueue) Send() <-chan int
- func (queue *IntQueue) Size() int
- func (queue *IntQueue) Sort()
- func (queue *IntQueue) Space() int
- func (queue *IntQueue) StableSort()
- func (queue *IntQueue) String() string
- func (queue *IntQueue) StringList() []string
- func (queue *IntQueue) Sum() int
- func (queue *IntQueue) Swap(i, j int)
- func (queue *IntQueue) ToInterfaceSlice() []interface{}
- func (queue *IntQueue) ToList() *IntList
- func (queue *IntQueue) ToSet() *IntSet
- func (queue *IntQueue) ToSlice() []int
- func (queue *IntQueue) UnmarshalJSON(b []byte) error
- type IntSequence
- type IntSet
- func (set *IntSet) Add(more ...int)
- func (set *IntSet) Cardinality() int
- func (set *IntSet) Clear()
- func (set *IntSet) Clone() *IntSet
- func (set *IntSet) Contains(i int) bool
- func (set *IntSet) ContainsAll(i ...int) bool
- func (set *IntSet) CountBy(p func(int) bool) (result int)
- func (set *IntSet) Difference(other *IntSet) *IntSet
- func (set *IntSet) Equals(other *IntSet) bool
- func (set *IntSet) Exists(p func(int) bool) bool
- func (set *IntSet) Filter(p func(int) bool) *IntSet
- func (set *IntSet) Find(p func(int) bool) (int, bool)
- func (set *IntSet) FlatMap(f func(int) []int) *IntSet
- func (set *IntSet) FlatMapToString(f func(int) []string) []string
- func (set *IntSet) Fold(initial int, fn func(int, int) int) int
- func (set *IntSet) Forall(p func(int) bool) bool
- func (set *IntSet) Foreach(f func(int))
- func (set *IntSet) GobDecode(b []byte) error
- func (set IntSet) GobEncode() ([]byte, error)
- func (set *IntSet) Intersect(other *IntSet) *IntSet
- func (set *IntSet) IsEmpty() bool
- func (set *IntSet) IsSequence() bool
- func (set *IntSet) IsSet() bool
- func (set *IntSet) IsSubset(other *IntSet) bool
- func (set *IntSet) IsSuperset(other *IntSet) bool
- func (set *IntSet) Map(f func(int) int) *IntSet
- func (set *IntSet) MapToString(f func(int) string) []string
- func (set *IntSet) MarshalJSON() ([]byte, error)
- func (set *IntSet) Max() (result int)
- func (set *IntSet) MaxBy(less func(int, int) bool) int
- func (set *IntSet) Min() int
- func (set *IntSet) MinBy(less func(int, int) bool) int
- func (set *IntSet) MkString(sep string) string
- func (set *IntSet) MkString3(before, between, after string) string
- func (set *IntSet) NonEmpty() bool
- func (set *IntSet) Partition(p func(int) bool) (*IntSet, *IntSet)
- func (set *IntSet) Remove(i int)
- func (set *IntSet) Send() <-chan int
- func (set *IntSet) Size() int
- func (set *IntSet) String() string
- func (set *IntSet) StringList() []string
- func (set *IntSet) StringMap() map[string]bool
- func (set *IntSet) Sum() int
- func (set *IntSet) SymmetricDifference(other *IntSet) *IntSet
- func (set *IntSet) ToInterfaceSlice() []interface{}
- func (set *IntSet) ToList() *IntList
- func (set *IntSet) ToSet() *IntSet
- func (set *IntSet) ToSlice() []int
- func (set *IntSet) Union(other *IntSet) *IntSet
- func (set *IntSet) UnmarshalJSON(b []byte) error
- type IntSizer
- type IntStringMap
- func (mm *IntStringMap) Clear()
- func (mm *IntStringMap) Clone() *IntStringMap
- func (mm *IntStringMap) ContainsAllKeys(kk ...int) bool
- func (mm *IntStringMap) ContainsKey(k int) bool
- func (mm *IntStringMap) DropWhere(fn func(int, string) bool) IntStringTuples
- func (mm *IntStringMap) Equals(other *IntStringMap) bool
- func (mm *IntStringMap) Exists(p func(int, string) bool) bool
- func (mm *IntStringMap) Filter(p func(int, string) bool) *IntStringMap
- func (mm *IntStringMap) Find(p func(int, string) bool) (IntStringTuple, bool)
- func (mm *IntStringMap) FlatMap(f func(int, string) []IntStringTuple) *IntStringMap
- func (mm *IntStringMap) Forall(p func(int, string) bool) bool
- func (mm *IntStringMap) Foreach(f func(int, string))
- func (mm *IntStringMap) Get(k int) (string, bool)
- func (mm *IntStringMap) GobDecode(b []byte) error
- func (mm *IntStringMap) GobEncode() ([]byte, error)
- func (mm *IntStringMap) IsEmpty() bool
- func (mm *IntStringMap) Keys() collection.IntList
- func (mm *IntStringMap) Map(f func(int, string) (int, string)) *IntStringMap
- func (mm *IntStringMap) MkString(sep string) string
- func (mm *IntStringMap) MkString4(before, between, after, equals string) string
- func (mm *IntStringMap) NonEmpty() bool
- func (mm *IntStringMap) OrderedSlice(keys collection.IntList) IntStringTuples
- func (mm *IntStringMap) Partition(p func(int, string) bool) (matching *IntStringMap, others *IntStringMap)
- func (mm *IntStringMap) Pop(k int) (string, bool)
- func (mm *IntStringMap) Put(k int, v string) bool
- func (mm *IntStringMap) Remove(k int)
- func (mm *IntStringMap) Size() int
- func (mm *IntStringMap) String() string
- func (mm *IntStringMap) ToSlice() IntStringTuples
- func (mm *IntStringMap) Values() collection.StringList
- type IntStringTuple
- type IntStringTuples
- func (ts IntStringTuples) Append1(k int, v string) IntStringTuples
- func (ts IntStringTuples) Append2(k1 int, v1 string, k2 int, v2 string) IntStringTuples
- func (ts IntStringTuples) Append3(k1 int, v1 string, k2 int, v2 string, k3 int, v3 string) IntStringTuples
- func (ts IntStringTuples) MkString(sep string) string
- func (ts IntStringTuples) MkString4(before, between, after, equals string) string
- func (ts IntStringTuples) String() string
- func (ts IntStringTuples) ToMap() *IntStringMap
- func (ts IntStringTuples) Values(values ...string) IntStringTuples
- type StringAnyMap
- func (mm *StringAnyMap) Clear()
- func (mm *StringAnyMap) Clone() *StringAnyMap
- func (mm *StringAnyMap) ContainsAllKeys(kk ...string) bool
- func (mm *StringAnyMap) ContainsKey(k string) bool
- func (mm *StringAnyMap) DropWhere(fn func(string, interface{}) bool) StringAnyTuples
- func (mm *StringAnyMap) Equals(other *StringAnyMap) bool
- func (mm *StringAnyMap) Exists(p func(string, interface{}) bool) bool
- func (mm *StringAnyMap) Filter(p func(string, interface{}) bool) *StringAnyMap
- func (mm *StringAnyMap) Find(p func(string, interface{}) bool) (StringAnyTuple, bool)
- func (mm *StringAnyMap) FlatMap(f func(string, interface{}) []StringAnyTuple) *StringAnyMap
- func (mm *StringAnyMap) Forall(p func(string, interface{}) bool) bool
- func (mm *StringAnyMap) Foreach(f func(string, interface{}))
- func (mm *StringAnyMap) Get(k string) (interface{}, bool)
- func (mm *StringAnyMap) GobDecode(b []byte) error
- func (mm *StringAnyMap) GobEncode() ([]byte, error)
- func (mm *StringAnyMap) IsEmpty() bool
- func (mm *StringAnyMap) Keys() collection.StringList
- func (mm *StringAnyMap) Map(f func(string, interface{}) (string, interface{})) *StringAnyMap
- func (mm *StringAnyMap) MarshalJSON() ([]byte, error)
- func (mm *StringAnyMap) MkString(sep string) string
- func (mm *StringAnyMap) MkString4(before, between, after, equals string) string
- func (mm *StringAnyMap) NonEmpty() bool
- func (mm *StringAnyMap) OrderedSlice(keys collection.StringList) StringAnyTuples
- func (mm *StringAnyMap) Partition(p func(string, interface{}) bool) (matching *StringAnyMap, others *StringAnyMap)
- func (mm *StringAnyMap) Pop(k string) (interface{}, bool)
- func (mm *StringAnyMap) Put(k string, v interface{}) bool
- func (mm *StringAnyMap) Remove(k string)
- func (mm *StringAnyMap) Size() int
- func (mm *StringAnyMap) String() string
- func (mm *StringAnyMap) ToSlice() StringAnyTuples
- func (mm *StringAnyMap) UnmarshalJSON(b []byte) error
- func (mm *StringAnyMap) Values() collection.AnyList
- type StringAnyTuple
- type StringAnyTuples
- func (ts StringAnyTuples) Append1(k string, v interface{}) StringAnyTuples
- func (ts StringAnyTuples) Append2(k1 string, v1 interface{}, k2 string, v2 interface{}) StringAnyTuples
- func (ts StringAnyTuples) Append3(k1 string, v1 interface{}, k2 string, v2 interface{}, k3 string, ...) StringAnyTuples
- func (ts StringAnyTuples) MkString(sep string) string
- func (ts StringAnyTuples) MkString4(before, between, after, equals string) string
- func (ts StringAnyTuples) String() string
- func (ts StringAnyTuples) ToMap() *StringAnyMap
- func (ts StringAnyTuples) Values(values ...interface{}) StringAnyTuples
- type StringCollection
- type StringIntMap
- func (mm *StringIntMap) Clear()
- func (mm *StringIntMap) Clone() *StringIntMap
- func (mm *StringIntMap) ContainsAllKeys(kk ...string) bool
- func (mm *StringIntMap) ContainsKey(k string) bool
- func (mm *StringIntMap) DropWhere(fn func(string, int) bool) StringIntTuples
- func (mm *StringIntMap) Equals(other *StringIntMap) bool
- func (mm *StringIntMap) Exists(p func(string, int) bool) bool
- func (mm *StringIntMap) Filter(p func(string, int) bool) *StringIntMap
- func (mm *StringIntMap) Find(p func(string, int) bool) (StringIntTuple, bool)
- func (mm *StringIntMap) FlatMap(f func(string, int) []StringIntTuple) *StringIntMap
- func (mm *StringIntMap) Forall(p func(string, int) bool) bool
- func (mm *StringIntMap) Foreach(f func(string, int))
- func (mm *StringIntMap) Get(k string) (int, bool)
- func (mm *StringIntMap) GobDecode(b []byte) error
- func (mm *StringIntMap) GobEncode() ([]byte, error)
- func (mm *StringIntMap) IsEmpty() bool
- func (mm *StringIntMap) Keys() collection.StringList
- func (mm *StringIntMap) Map(f func(string, int) (string, int)) *StringIntMap
- func (mm *StringIntMap) MarshalJSON() ([]byte, error)
- func (mm *StringIntMap) MkString(sep string) string
- func (mm *StringIntMap) MkString4(before, between, after, equals string) string
- func (mm *StringIntMap) NonEmpty() bool
- func (mm *StringIntMap) OrderedSlice(keys collection.StringList) StringIntTuples
- func (mm *StringIntMap) Partition(p func(string, int) bool) (matching *StringIntMap, others *StringIntMap)
- func (mm *StringIntMap) Pop(k string) (int, bool)
- func (mm *StringIntMap) Put(k string, v int) bool
- func (mm *StringIntMap) Remove(k string)
- func (mm *StringIntMap) Size() int
- func (mm *StringIntMap) String() string
- func (mm *StringIntMap) ToSlice() StringIntTuples
- func (mm *StringIntMap) UnmarshalJSON(b []byte) error
- func (mm *StringIntMap) Values() collection.IntList
- type StringIntTuple
- type StringIntTuples
- func (ts StringIntTuples) Append1(k string, v int) StringIntTuples
- func (ts StringIntTuples) Append2(k1 string, v1 int, k2 string, v2 int) StringIntTuples
- func (ts StringIntTuples) Append3(k1 string, v1 int, k2 string, v2 int, k3 string, v3 int) StringIntTuples
- func (ts StringIntTuples) MkString(sep string) string
- func (ts StringIntTuples) MkString4(before, between, after, equals string) string
- func (ts StringIntTuples) String() string
- func (ts StringIntTuples) ToMap() *StringIntMap
- func (ts StringIntTuples) Values(values ...int) StringIntTuples
- type StringList
- func (list *StringList) Add(more ...string)
- func (list *StringList) Append(more ...string) *StringList
- func (list *StringList) Clear()
- func (list *StringList) Clone() *StringList
- func (list *StringList) Contains(v string) bool
- func (list *StringList) ContainsAll(i ...string) bool
- func (list *StringList) CountBy(p func(string) bool) (result int)
- func (list *StringList) DistinctBy(equal func(string, string) bool) *StringList
- func (list *StringList) DoDeleteAt(index, n int) *StringList
- func (list *StringList) DoDeleteFirst(n int) *StringList
- func (list *StringList) DoDeleteLast(n int) *StringList
- func (list *StringList) DoInsertAt(index int, more ...string) *StringList
- func (list *StringList) DoKeepWhere(p func(string) bool) *StringList
- func (list *StringList) DoReverse() *StringList
- func (list *StringList) DoShuffle() *StringList
- func (list *StringList) Drop(n int) *StringList
- func (list *StringList) DropLast(n int) *StringList
- func (list *StringList) DropWhile(p func(string) bool) *StringList
- func (list *StringList) Equals(other *StringList) bool
- func (list *StringList) Exists(p func(string) bool) bool
- func (list *StringList) Filter(p func(string) bool) *StringList
- func (list *StringList) Find(p func(string) bool) (string, bool)
- func (list *StringList) FlatMap(f func(string) []string) *StringList
- func (list *StringList) FlatMapToInt(f func(string) []int) []int
- func (list *StringList) Fold(initial string, fn func(string, string) string) string
- func (list *StringList) Forall(p func(string) bool) bool
- func (list *StringList) Foreach(f func(string))
- func (list *StringList) Get(i int) string
- func (list *StringList) GobDecode(b []byte) error
- func (list StringList) GobEncode() ([]byte, error)
- func (list *StringList) Head() string
- func (list *StringList) HeadOption() (string, bool)
- func (list *StringList) IndexWhere(p func(string) bool) int
- func (list *StringList) IndexWhere2(p func(string) bool, from int) int
- func (list *StringList) Init() *StringList
- func (list *StringList) IsEmpty() bool
- func (list *StringList) IsSequence() bool
- func (list *StringList) IsSet() bool
- func (list *StringList) Last() string
- func (list *StringList) LastIndexWhere(p func(string) bool) int
- func (list *StringList) LastIndexWhere2(p func(string) bool, before int) int
- func (list *StringList) LastOption() (string, bool)
- func (list *StringList) Len() int
- func (list *StringList) Map(f func(string) string) *StringList
- func (list *StringList) MapToInt(f func(string) int) []int
- func (list StringList) MarshalJSON() ([]byte, error)
- func (list *StringList) MaxBy(less func(string, string) bool) string
- func (list *StringList) MinBy(less func(string, string) bool) string
- func (list *StringList) MkString(sep string) string
- func (list *StringList) MkString3(before, between, after string) string
- func (list *StringList) NonEmpty() bool
- func (list *StringList) Partition(p func(string) bool) (*StringList, *StringList)
- func (list *StringList) Reverse() *StringList
- func (list *StringList) Send() <-chan string
- func (list *StringList) Shuffle() *StringList
- func (list *StringList) Size() int
- func (list *StringList) SortBy(less func(i, j string) bool) *StringList
- func (list *StringList) Sorted() *StringList
- func (list *StringList) StableSortBy(less func(i, j string) bool) *StringList
- func (list *StringList) String() string
- func (list *StringList) StringList() []string
- func (list *StringList) Swap(i, j int)
- func (list *StringList) Tail() *StringList
- func (list *StringList) Take(n int) *StringList
- func (list *StringList) TakeLast(n int) *StringList
- func (list *StringList) TakeWhile(p func(string) bool) *StringList
- func (list *StringList) ToInterfaceSlice() []interface{}
- func (list *StringList) ToList() *StringList
- func (list *StringList) ToSet() *StringSet
- func (list *StringList) ToSlice() []string
- func (list *StringList) UnmarshalJSON(b []byte) error
- type StringMkStringer
- type StringQueue
- func (queue *StringQueue) Add(more ...string)
- func (queue *StringQueue) Cap() int
- func (queue *StringQueue) Clear()
- func (queue *StringQueue) Clone() *StringQueue
- func (queue *StringQueue) Contains(v string) bool
- func (queue *StringQueue) ContainsAll(i ...string) bool
- func (queue *StringQueue) CountBy(p func(string) bool) (result int)
- func (queue *StringQueue) DoKeepWhere(p func(string) bool) *StringQueue
- func (queue *StringQueue) Equals(other *StringQueue) bool
- func (queue *StringQueue) Exists(p func(string) bool) bool
- func (queue *StringQueue) Filter(p func(string) bool) *StringQueue
- func (queue *StringQueue) Find(p func(string) bool) (string, bool)
- func (queue *StringQueue) FlatMap(f func(string) []string) *StringQueue
- func (queue *StringQueue) FlatMapToInt(f func(string) []int) []int
- func (queue *StringQueue) Fold(initial string, fn func(string, string) string) string
- func (queue *StringQueue) Forall(p func(string) bool) bool
- func (queue *StringQueue) Foreach(f func(string))
- func (queue *StringQueue) Get(i int) string
- func (queue *StringQueue) Head() string
- func (queue *StringQueue) HeadOption() (string, bool)
- func (queue *StringQueue) IsEmpty() bool
- func (queue *StringQueue) IsFull() bool
- func (queue *StringQueue) IsOverwriting() bool
- func (queue *StringQueue) IsSequence() bool
- func (queue *StringQueue) IsSet() bool
- func (queue *StringQueue) Last() string
- func (queue *StringQueue) LastOption() (string, bool)
- func (queue *StringQueue) Len() int
- func (queue *StringQueue) Less(i, j int) bool
- func (queue *StringQueue) Map(f func(string) string) *StringQueue
- func (queue *StringQueue) MapToInt(f func(string) int) []int
- func (queue StringQueue) MarshalJSON() ([]byte, error)
- func (queue *StringQueue) MaxBy(less func(string, string) bool) string
- func (queue *StringQueue) MinBy(less func(string, string) bool) string
- func (queue *StringQueue) MkString(sep string) string
- func (queue *StringQueue) MkString3(before, between, after string) string
- func (queue *StringQueue) NonEmpty() bool
- func (queue *StringQueue) Offer(items ...string) []string
- func (queue *StringQueue) Partition(p func(string) bool) (*StringQueue, *StringQueue)
- func (queue *StringQueue) Pop(n int) []string
- func (queue *StringQueue) Pop1() (string, bool)
- func (queue *StringQueue) Push(items ...string) *StringQueue
- func (queue *StringQueue) Reallocate(capacity int, overwrite bool) *StringQueue
- func (queue *StringQueue) Send() <-chan string
- func (queue *StringQueue) Size() int
- func (queue *StringQueue) Sort()
- func (queue *StringQueue) Space() int
- func (queue *StringQueue) StableSort()
- func (queue *StringQueue) String() string
- func (queue *StringQueue) StringList() []string
- func (queue *StringQueue) Swap(i, j int)
- func (queue *StringQueue) ToInterfaceSlice() []interface{}
- func (queue *StringQueue) ToList() *StringList
- func (queue *StringQueue) ToSet() *StringSet
- func (queue *StringQueue) ToSlice() []string
- func (queue *StringQueue) UnmarshalJSON(b []byte) error
- type StringSequence
- type StringSet
- func (set *StringSet) Add(more ...string)
- func (set *StringSet) Cardinality() int
- func (set *StringSet) Clear()
- func (set *StringSet) Clone() *StringSet
- func (set *StringSet) Contains(i string) bool
- func (set *StringSet) ContainsAll(i ...string) bool
- func (set *StringSet) CountBy(p func(string) bool) (result int)
- func (set *StringSet) Difference(other *StringSet) *StringSet
- func (set *StringSet) Equals(other *StringSet) bool
- func (set *StringSet) Exists(p func(string) bool) bool
- func (set *StringSet) Filter(p func(string) bool) *StringSet
- func (set *StringSet) Find(p func(string) bool) (string, bool)
- func (set *StringSet) FlatMap(f func(string) []string) *StringSet
- func (set *StringSet) FlatMapToInt(f func(string) []int) []int
- func (set *StringSet) Fold(initial string, fn func(string, string) string) string
- func (set *StringSet) Forall(p func(string) bool) bool
- func (set *StringSet) Foreach(f func(string))
- func (set *StringSet) GobDecode(b []byte) error
- func (set StringSet) GobEncode() ([]byte, error)
- func (set *StringSet) Intersect(other *StringSet) *StringSet
- func (set *StringSet) IsEmpty() bool
- func (set *StringSet) IsSequence() bool
- func (set *StringSet) IsSet() bool
- func (set *StringSet) IsSubset(other *StringSet) bool
- func (set *StringSet) IsSuperset(other *StringSet) bool
- func (set *StringSet) Map(f func(string) string) *StringSet
- func (set *StringSet) MapToInt(f func(string) int) []int
- func (set *StringSet) MarshalJSON() ([]byte, error)
- func (set *StringSet) MaxBy(less func(string, string) bool) string
- func (set *StringSet) MinBy(less func(string, string) bool) string
- func (set *StringSet) MkString(sep string) string
- func (set *StringSet) MkString3(before, between, after string) string
- func (set *StringSet) NonEmpty() bool
- func (set *StringSet) Partition(p func(string) bool) (*StringSet, *StringSet)
- func (set *StringSet) Remove(i string)
- func (set *StringSet) Send() <-chan string
- func (set *StringSet) Size() int
- func (set *StringSet) String() string
- func (set *StringSet) StringList() []string
- func (set *StringSet) StringMap() map[string]bool
- func (set *StringSet) SymmetricDifference(other *StringSet) *StringSet
- func (set *StringSet) ToInterfaceSlice() []interface{}
- func (set *StringSet) ToList() *StringList
- func (set *StringSet) ToSet() *StringSet
- func (set *StringSet) ToSlice() []string
- func (set *StringSet) Union(other *StringSet) *StringSet
- func (set *StringSet) UnmarshalJSON(b []byte) error
- type StringSizer
- type StringStringMap
- func (mm *StringStringMap) Clear()
- func (mm *StringStringMap) Clone() *StringStringMap
- func (mm *StringStringMap) ContainsAllKeys(kk ...string) bool
- func (mm *StringStringMap) ContainsKey(k string) bool
- func (mm *StringStringMap) DropWhere(fn func(string, string) bool) StringStringTuples
- func (mm *StringStringMap) Equals(other *StringStringMap) bool
- func (mm *StringStringMap) Exists(p func(string, string) bool) bool
- func (mm *StringStringMap) Filter(p func(string, string) bool) *StringStringMap
- func (mm *StringStringMap) Find(p func(string, string) bool) (StringStringTuple, bool)
- func (mm *StringStringMap) FlatMap(f func(string, string) []StringStringTuple) *StringStringMap
- func (mm *StringStringMap) Forall(p func(string, string) bool) bool
- func (mm *StringStringMap) Foreach(f func(string, string))
- func (mm *StringStringMap) Get(k string) (string, bool)
- func (mm *StringStringMap) GobDecode(b []byte) error
- func (mm *StringStringMap) GobEncode() ([]byte, error)
- func (mm *StringStringMap) IsEmpty() bool
- func (mm *StringStringMap) Keys() collection.StringList
- func (mm *StringStringMap) Map(f func(string, string) (string, string)) *StringStringMap
- func (mm *StringStringMap) MarshalJSON() ([]byte, error)
- func (mm *StringStringMap) MkString(sep string) string
- func (mm *StringStringMap) MkString4(before, between, after, equals string) string
- func (mm *StringStringMap) NonEmpty() bool
- func (mm *StringStringMap) OrderedSlice(keys collection.StringList) StringStringTuples
- func (mm *StringStringMap) Partition(p func(string, string) bool) (matching *StringStringMap, others *StringStringMap)
- func (mm *StringStringMap) Pop(k string) (string, bool)
- func (mm *StringStringMap) Put(k string, v string) bool
- func (mm *StringStringMap) Remove(k string)
- func (mm *StringStringMap) Size() int
- func (mm *StringStringMap) String() string
- func (mm *StringStringMap) ToSlice() StringStringTuples
- func (mm *StringStringMap) UnmarshalJSON(b []byte) error
- func (mm *StringStringMap) Values() collection.StringList
- type StringStringTuple
- type StringStringTuples
- func (ts StringStringTuples) Append1(k string, v string) StringStringTuples
- func (ts StringStringTuples) Append2(k1 string, v1 string, k2 string, v2 string) StringStringTuples
- func (ts StringStringTuples) Append3(k1 string, v1 string, k2 string, v2 string, k3 string, v3 string) StringStringTuples
- func (ts StringStringTuples) MkString(sep string) string
- func (ts StringStringTuples) MkString4(before, between, after, equals string) string
- func (ts StringStringTuples) String() string
- func (ts StringStringTuples) ToMap() *StringStringMap
- func (ts StringStringTuples) Values(values ...string) StringStringTuples
- type StringUintMap
- func (mm *StringUintMap) Clear()
- func (mm *StringUintMap) Clone() *StringUintMap
- func (mm *StringUintMap) ContainsAllKeys(kk ...string) bool
- func (mm *StringUintMap) ContainsKey(k string) bool
- func (mm *StringUintMap) DropWhere(fn func(string, uint) bool) StringUintTuples
- func (mm *StringUintMap) Equals(other *StringUintMap) bool
- func (mm *StringUintMap) Exists(p func(string, uint) bool) bool
- func (mm *StringUintMap) Filter(p func(string, uint) bool) *StringUintMap
- func (mm *StringUintMap) Find(p func(string, uint) bool) (StringUintTuple, bool)
- func (mm *StringUintMap) FlatMap(f func(string, uint) []StringUintTuple) *StringUintMap
- func (mm *StringUintMap) Forall(p func(string, uint) bool) bool
- func (mm *StringUintMap) Foreach(f func(string, uint))
- func (mm *StringUintMap) Get(k string) (uint, bool)
- func (mm *StringUintMap) GobDecode(b []byte) error
- func (mm *StringUintMap) GobEncode() ([]byte, error)
- func (mm *StringUintMap) IsEmpty() bool
- func (mm *StringUintMap) Keys() collection.StringList
- func (mm *StringUintMap) Map(f func(string, uint) (string, uint)) *StringUintMap
- func (mm *StringUintMap) MarshalJSON() ([]byte, error)
- func (mm *StringUintMap) MkString(sep string) string
- func (mm *StringUintMap) MkString4(before, between, after, equals string) string
- func (mm *StringUintMap) NonEmpty() bool
- func (mm *StringUintMap) OrderedSlice(keys collection.StringList) StringUintTuples
- func (mm *StringUintMap) Partition(p func(string, uint) bool) (matching *StringUintMap, others *StringUintMap)
- func (mm *StringUintMap) Pop(k string) (uint, bool)
- func (mm *StringUintMap) Put(k string, v uint) bool
- func (mm *StringUintMap) Remove(k string)
- func (mm *StringUintMap) Size() int
- func (mm *StringUintMap) String() string
- func (mm *StringUintMap) ToSlice() StringUintTuples
- func (mm *StringUintMap) UnmarshalJSON(b []byte) error
- func (mm *StringUintMap) Values() collection.UintList
- type StringUintTuple
- type StringUintTuples
- func (ts StringUintTuples) Append1(k string, v uint) StringUintTuples
- func (ts StringUintTuples) Append2(k1 string, v1 uint, k2 string, v2 uint) StringUintTuples
- func (ts StringUintTuples) Append3(k1 string, v1 uint, k2 string, v2 uint, k3 string, v3 uint) StringUintTuples
- func (ts StringUintTuples) MkString(sep string) string
- func (ts StringUintTuples) MkString4(before, between, after, equals string) string
- func (ts StringUintTuples) String() string
- func (ts StringUintTuples) ToMap() *StringUintMap
- func (ts StringUintTuples) Values(values ...uint) StringUintTuples
- type Uint64Collection
- type Uint64List
- func (list *Uint64List) Add(more ...uint64)
- func (list *Uint64List) Append(more ...uint64) *Uint64List
- func (list *Uint64List) Clear()
- func (list *Uint64List) Clone() *Uint64List
- func (list *Uint64List) Contains(v uint64) bool
- func (list *Uint64List) ContainsAll(i ...uint64) bool
- func (list *Uint64List) CountBy(p func(uint64) bool) (result int)
- func (list *Uint64List) DistinctBy(equal func(uint64, uint64) bool) *Uint64List
- func (list *Uint64List) DoDeleteAt(index, n int) *Uint64List
- func (list *Uint64List) DoDeleteFirst(n int) *Uint64List
- func (list *Uint64List) DoDeleteLast(n int) *Uint64List
- func (list *Uint64List) DoInsertAt(index int, more ...uint64) *Uint64List
- func (list *Uint64List) DoKeepWhere(p func(uint64) bool) *Uint64List
- func (list *Uint64List) DoReverse() *Uint64List
- func (list *Uint64List) DoShuffle() *Uint64List
- func (list *Uint64List) Drop(n int) *Uint64List
- func (list *Uint64List) DropLast(n int) *Uint64List
- func (list *Uint64List) DropWhile(p func(uint64) bool) *Uint64List
- func (list *Uint64List) Equals(other *Uint64List) bool
- func (list *Uint64List) Exists(p func(uint64) bool) bool
- func (list *Uint64List) Filter(p func(uint64) bool) *Uint64List
- func (list *Uint64List) Find(p func(uint64) bool) (uint64, bool)
- func (list *Uint64List) FlatMap(f func(uint64) []uint64) *Uint64List
- func (list *Uint64List) FlatMapToString(f func(uint64) []string) []string
- func (list *Uint64List) Fold(initial uint64, fn func(uint64, uint64) uint64) uint64
- func (list *Uint64List) Forall(p func(uint64) bool) bool
- func (list *Uint64List) Foreach(f func(uint64))
- func (list *Uint64List) Get(i int) uint64
- func (list *Uint64List) GobDecode(b []byte) error
- func (list Uint64List) GobEncode() ([]byte, error)
- func (list *Uint64List) Head() uint64
- func (list *Uint64List) HeadOption() (uint64, bool)
- func (list *Uint64List) IndexWhere(p func(uint64) bool) int
- func (list *Uint64List) IndexWhere2(p func(uint64) bool, from int) int
- func (list *Uint64List) Init() *Uint64List
- func (list *Uint64List) IsEmpty() bool
- func (list *Uint64List) IsSequence() bool
- func (list *Uint64List) IsSet() bool
- func (list *Uint64List) Last() uint64
- func (list *Uint64List) LastIndexWhere(p func(uint64) bool) int
- func (list *Uint64List) LastIndexWhere2(p func(uint64) bool, before int) int
- func (list *Uint64List) LastOption() (uint64, bool)
- func (list *Uint64List) Len() int
- func (list *Uint64List) Map(f func(uint64) uint64) *Uint64List
- func (list *Uint64List) MapToString(f func(uint64) string) []string
- func (list Uint64List) MarshalJSON() ([]byte, error)
- func (list *Uint64List) Max() (result uint64)
- func (list *Uint64List) MaxBy(less func(uint64, uint64) bool) uint64
- func (list *Uint64List) Min() uint64
- func (list *Uint64List) MinBy(less func(uint64, uint64) bool) uint64
- func (list *Uint64List) MkString(sep string) string
- func (list *Uint64List) MkString3(before, between, after string) string
- func (list *Uint64List) NonEmpty() bool
- func (list *Uint64List) Partition(p func(uint64) bool) (*Uint64List, *Uint64List)
- func (list *Uint64List) Reverse() *Uint64List
- func (list *Uint64List) Send() <-chan uint64
- func (list *Uint64List) Shuffle() *Uint64List
- func (list *Uint64List) Size() int
- func (list *Uint64List) SortBy(less func(i, j uint64) bool) *Uint64List
- func (list *Uint64List) Sorted() *Uint64List
- func (list *Uint64List) StableSortBy(less func(i, j uint64) bool) *Uint64List
- func (list *Uint64List) StableSorted() *Uint64List
- func (list *Uint64List) String() string
- func (list *Uint64List) StringList() []string
- func (list *Uint64List) Sum() uint64
- func (list *Uint64List) Swap(i, j int)
- func (list *Uint64List) Tail() *Uint64List
- func (list *Uint64List) Take(n int) *Uint64List
- func (list *Uint64List) TakeLast(n int) *Uint64List
- func (list *Uint64List) TakeWhile(p func(uint64) bool) *Uint64List
- func (list *Uint64List) ToInterfaceSlice() []interface{}
- func (list *Uint64List) ToList() *Uint64List
- func (list *Uint64List) ToSet() *Uint64Set
- func (list *Uint64List) ToSlice() []uint64
- func (list *Uint64List) UnmarshalJSON(b []byte) error
- type Uint64MkStringer
- type Uint64Queue
- func (queue *Uint64Queue) Add(more ...uint64)
- func (queue *Uint64Queue) Cap() int
- func (queue *Uint64Queue) Clear()
- func (queue *Uint64Queue) Clone() *Uint64Queue
- func (queue *Uint64Queue) Contains(v uint64) bool
- func (queue *Uint64Queue) ContainsAll(i ...uint64) bool
- func (queue *Uint64Queue) CountBy(p func(uint64) bool) (result int)
- func (queue *Uint64Queue) DoKeepWhere(p func(uint64) bool) *Uint64Queue
- func (queue *Uint64Queue) Equals(other *Uint64Queue) bool
- func (queue *Uint64Queue) Exists(p func(uint64) bool) bool
- func (queue *Uint64Queue) Filter(p func(uint64) bool) *Uint64Queue
- func (queue *Uint64Queue) Find(p func(uint64) bool) (uint64, bool)
- func (queue *Uint64Queue) FlatMap(f func(uint64) []uint64) *Uint64Queue
- func (queue *Uint64Queue) FlatMapToString(f func(uint64) []string) []string
- func (queue *Uint64Queue) Fold(initial uint64, fn func(uint64, uint64) uint64) uint64
- func (queue *Uint64Queue) Forall(p func(uint64) bool) bool
- func (queue *Uint64Queue) Foreach(f func(uint64))
- func (queue *Uint64Queue) Get(i int) uint64
- func (queue *Uint64Queue) Head() uint64
- func (queue *Uint64Queue) HeadOption() (uint64, bool)
- func (queue *Uint64Queue) IsEmpty() bool
- func (queue *Uint64Queue) IsFull() bool
- func (queue *Uint64Queue) IsOverwriting() bool
- func (queue *Uint64Queue) IsSequence() bool
- func (queue *Uint64Queue) IsSet() bool
- func (queue *Uint64Queue) Last() uint64
- func (queue *Uint64Queue) LastOption() (uint64, bool)
- func (queue *Uint64Queue) Len() int
- func (queue *Uint64Queue) Less(i, j int) bool
- func (queue *Uint64Queue) Map(f func(uint64) uint64) *Uint64Queue
- func (queue *Uint64Queue) MapToString(f func(uint64) string) []string
- func (queue Uint64Queue) MarshalJSON() ([]byte, error)
- func (queue *Uint64Queue) Max() (result uint64)
- func (queue *Uint64Queue) MaxBy(less func(uint64, uint64) bool) uint64
- func (queue *Uint64Queue) Min() uint64
- func (queue *Uint64Queue) MinBy(less func(uint64, uint64) bool) uint64
- func (queue *Uint64Queue) MkString(sep string) string
- func (queue *Uint64Queue) MkString3(before, between, after string) string
- func (queue *Uint64Queue) NonEmpty() bool
- func (queue *Uint64Queue) Offer(items ...uint64) []uint64
- func (queue *Uint64Queue) Partition(p func(uint64) bool) (*Uint64Queue, *Uint64Queue)
- func (queue *Uint64Queue) Pop(n int) []uint64
- func (queue *Uint64Queue) Pop1() (uint64, bool)
- func (queue *Uint64Queue) Push(items ...uint64) *Uint64Queue
- func (queue *Uint64Queue) Reallocate(capacity int, overwrite bool) *Uint64Queue
- func (queue *Uint64Queue) Send() <-chan uint64
- func (queue *Uint64Queue) Size() int
- func (queue *Uint64Queue) Sort()
- func (queue *Uint64Queue) Space() int
- func (queue *Uint64Queue) StableSort()
- func (queue *Uint64Queue) String() string
- func (queue *Uint64Queue) StringList() []string
- func (queue *Uint64Queue) Sum() uint64
- func (queue *Uint64Queue) Swap(i, j int)
- func (queue *Uint64Queue) ToInterfaceSlice() []interface{}
- func (queue *Uint64Queue) ToList() *Uint64List
- func (queue *Uint64Queue) ToSet() *Uint64Set
- func (queue *Uint64Queue) ToSlice() []uint64
- func (queue *Uint64Queue) UnmarshalJSON(b []byte) error
- type Uint64Sequence
- type Uint64Set
- func (set *Uint64Set) Add(more ...uint64)
- func (set *Uint64Set) Cardinality() int
- func (set *Uint64Set) Clear()
- func (set *Uint64Set) Clone() *Uint64Set
- func (set *Uint64Set) Contains(i uint64) bool
- func (set *Uint64Set) ContainsAll(i ...uint64) bool
- func (set *Uint64Set) CountBy(p func(uint64) bool) (result int)
- func (set *Uint64Set) Difference(other *Uint64Set) *Uint64Set
- func (set *Uint64Set) Equals(other *Uint64Set) bool
- func (set *Uint64Set) Exists(p func(uint64) bool) bool
- func (set *Uint64Set) Filter(p func(uint64) bool) *Uint64Set
- func (set *Uint64Set) Find(p func(uint64) bool) (uint64, bool)
- func (set *Uint64Set) FlatMap(f func(uint64) []uint64) *Uint64Set
- func (set *Uint64Set) FlatMapToString(f func(uint64) []string) []string
- func (set *Uint64Set) Fold(initial uint64, fn func(uint64, uint64) uint64) uint64
- func (set *Uint64Set) Forall(p func(uint64) bool) bool
- func (set *Uint64Set) Foreach(f func(uint64))
- func (set *Uint64Set) GobDecode(b []byte) error
- func (set Uint64Set) GobEncode() ([]byte, error)
- func (set *Uint64Set) Intersect(other *Uint64Set) *Uint64Set
- func (set *Uint64Set) IsEmpty() bool
- func (set *Uint64Set) IsSequence() bool
- func (set *Uint64Set) IsSet() bool
- func (set *Uint64Set) IsSubset(other *Uint64Set) bool
- func (set *Uint64Set) IsSuperset(other *Uint64Set) bool
- func (set *Uint64Set) Map(f func(uint64) uint64) *Uint64Set
- func (set *Uint64Set) MapToString(f func(uint64) string) []string
- func (set *Uint64Set) MarshalJSON() ([]byte, error)
- func (set *Uint64Set) Max() (result uint64)
- func (set *Uint64Set) MaxBy(less func(uint64, uint64) bool) uint64
- func (set *Uint64Set) Min() uint64
- func (set *Uint64Set) MinBy(less func(uint64, uint64) bool) uint64
- func (set *Uint64Set) MkString(sep string) string
- func (set *Uint64Set) MkString3(before, between, after string) string
- func (set *Uint64Set) NonEmpty() bool
- func (set *Uint64Set) Partition(p func(uint64) bool) (*Uint64Set, *Uint64Set)
- func (set *Uint64Set) Remove(i uint64)
- func (set *Uint64Set) Send() <-chan uint64
- func (set *Uint64Set) Size() int
- func (set *Uint64Set) String() string
- func (set *Uint64Set) StringList() []string
- func (set *Uint64Set) StringMap() map[string]bool
- func (set *Uint64Set) Sum() uint64
- func (set *Uint64Set) SymmetricDifference(other *Uint64Set) *Uint64Set
- func (set *Uint64Set) ToInterfaceSlice() []interface{}
- func (set *Uint64Set) ToList() *Uint64List
- func (set *Uint64Set) ToSet() *Uint64Set
- func (set *Uint64Set) ToSlice() []uint64
- func (set *Uint64Set) Union(other *Uint64Set) *Uint64Set
- func (set *Uint64Set) UnmarshalJSON(b []byte) error
- type Uint64Sizer
- type Uint64StringMap
- func (mm *Uint64StringMap) Clear()
- func (mm *Uint64StringMap) Clone() *Uint64StringMap
- func (mm *Uint64StringMap) ContainsAllKeys(kk ...uint64) bool
- func (mm *Uint64StringMap) ContainsKey(k uint64) bool
- func (mm *Uint64StringMap) DropWhere(fn func(uint64, string) bool) Uint64StringTuples
- func (mm *Uint64StringMap) Equals(other *Uint64StringMap) bool
- func (mm *Uint64StringMap) Exists(p func(uint64, string) bool) bool
- func (mm *Uint64StringMap) Filter(p func(uint64, string) bool) *Uint64StringMap
- func (mm *Uint64StringMap) Find(p func(uint64, string) bool) (Uint64StringTuple, bool)
- func (mm *Uint64StringMap) FlatMap(f func(uint64, string) []Uint64StringTuple) *Uint64StringMap
- func (mm *Uint64StringMap) Forall(p func(uint64, string) bool) bool
- func (mm *Uint64StringMap) Foreach(f func(uint64, string))
- func (mm *Uint64StringMap) Get(k uint64) (string, bool)
- func (mm *Uint64StringMap) GobDecode(b []byte) error
- func (mm *Uint64StringMap) GobEncode() ([]byte, error)
- func (mm *Uint64StringMap) IsEmpty() bool
- func (mm *Uint64StringMap) Keys() collection.Uint64List
- func (mm *Uint64StringMap) Map(f func(uint64, string) (uint64, string)) *Uint64StringMap
- func (mm *Uint64StringMap) MkString(sep string) string
- func (mm *Uint64StringMap) MkString4(before, between, after, equals string) string
- func (mm *Uint64StringMap) NonEmpty() bool
- func (mm *Uint64StringMap) OrderedSlice(keys collection.Uint64List) Uint64StringTuples
- func (mm *Uint64StringMap) Partition(p func(uint64, string) bool) (matching *Uint64StringMap, others *Uint64StringMap)
- func (mm *Uint64StringMap) Pop(k uint64) (string, bool)
- func (mm *Uint64StringMap) Put(k uint64, v string) bool
- func (mm *Uint64StringMap) Remove(k uint64)
- func (mm *Uint64StringMap) Size() int
- func (mm *Uint64StringMap) String() string
- func (mm *Uint64StringMap) ToSlice() Uint64StringTuples
- func (mm *Uint64StringMap) Values() collection.StringList
- type Uint64StringTuple
- type Uint64StringTuples
- func (ts Uint64StringTuples) Append1(k uint64, v string) Uint64StringTuples
- func (ts Uint64StringTuples) Append2(k1 uint64, v1 string, k2 uint64, v2 string) Uint64StringTuples
- func (ts Uint64StringTuples) Append3(k1 uint64, v1 string, k2 uint64, v2 string, k3 uint64, v3 string) Uint64StringTuples
- func (ts Uint64StringTuples) MkString(sep string) string
- func (ts Uint64StringTuples) MkString4(before, between, after, equals string) string
- func (ts Uint64StringTuples) String() string
- func (ts Uint64StringTuples) ToMap() *Uint64StringMap
- func (ts Uint64StringTuples) Values(values ...string) Uint64StringTuples
- type Uint64Uint64Map
- func (mm *Uint64Uint64Map) Clear()
- func (mm *Uint64Uint64Map) Clone() *Uint64Uint64Map
- func (mm *Uint64Uint64Map) ContainsAllKeys(kk ...uint64) bool
- func (mm *Uint64Uint64Map) ContainsKey(k uint64) bool
- func (mm *Uint64Uint64Map) DropWhere(fn func(uint64, uint64) bool) Uint64Uint64Tuples
- func (mm *Uint64Uint64Map) Equals(other *Uint64Uint64Map) bool
- func (mm *Uint64Uint64Map) Exists(p func(uint64, uint64) bool) bool
- func (mm *Uint64Uint64Map) Filter(p func(uint64, uint64) bool) *Uint64Uint64Map
- func (mm *Uint64Uint64Map) Find(p func(uint64, uint64) bool) (Uint64Uint64Tuple, bool)
- func (mm *Uint64Uint64Map) FlatMap(f func(uint64, uint64) []Uint64Uint64Tuple) *Uint64Uint64Map
- func (mm *Uint64Uint64Map) Forall(p func(uint64, uint64) bool) bool
- func (mm *Uint64Uint64Map) Foreach(f func(uint64, uint64))
- func (mm *Uint64Uint64Map) Get(k uint64) (uint64, bool)
- func (mm *Uint64Uint64Map) GobDecode(b []byte) error
- func (mm *Uint64Uint64Map) GobEncode() ([]byte, error)
- func (mm *Uint64Uint64Map) IsEmpty() bool
- func (mm *Uint64Uint64Map) Keys() collection.Uint64List
- func (mm *Uint64Uint64Map) Map(f func(uint64, uint64) (uint64, uint64)) *Uint64Uint64Map
- func (mm *Uint64Uint64Map) MkString(sep string) string
- func (mm *Uint64Uint64Map) MkString4(before, between, after, equals string) string
- func (mm *Uint64Uint64Map) NonEmpty() bool
- func (mm *Uint64Uint64Map) OrderedSlice(keys collection.Uint64List) Uint64Uint64Tuples
- func (mm *Uint64Uint64Map) Partition(p func(uint64, uint64) bool) (matching *Uint64Uint64Map, others *Uint64Uint64Map)
- func (mm *Uint64Uint64Map) Pop(k uint64) (uint64, bool)
- func (mm *Uint64Uint64Map) Put(k uint64, v uint64) bool
- func (mm *Uint64Uint64Map) Remove(k uint64)
- func (mm *Uint64Uint64Map) Size() int
- func (mm *Uint64Uint64Map) String() string
- func (mm *Uint64Uint64Map) ToSlice() Uint64Uint64Tuples
- func (mm *Uint64Uint64Map) Values() collection.Uint64List
- type Uint64Uint64Tuple
- type Uint64Uint64Tuples
- func (ts Uint64Uint64Tuples) Append1(k uint64, v uint64) Uint64Uint64Tuples
- func (ts Uint64Uint64Tuples) Append2(k1 uint64, v1 uint64, k2 uint64, v2 uint64) Uint64Uint64Tuples
- func (ts Uint64Uint64Tuples) Append3(k1 uint64, v1 uint64, k2 uint64, v2 uint64, k3 uint64, v3 uint64) Uint64Uint64Tuples
- func (ts Uint64Uint64Tuples) MkString(sep string) string
- func (ts Uint64Uint64Tuples) MkString4(before, between, after, equals string) string
- func (ts Uint64Uint64Tuples) String() string
- func (ts Uint64Uint64Tuples) ToMap() *Uint64Uint64Map
- func (ts Uint64Uint64Tuples) Values(values ...uint64) Uint64Uint64Tuples
- type UintCollection
- type UintList
- func (list *UintList) Add(more ...uint)
- func (list *UintList) Append(more ...uint) *UintList
- func (list *UintList) Clear()
- func (list *UintList) Clone() *UintList
- func (list *UintList) Contains(v uint) bool
- func (list *UintList) ContainsAll(i ...uint) bool
- func (list *UintList) CountBy(p func(uint) bool) (result int)
- func (list *UintList) DistinctBy(equal func(uint, uint) bool) *UintList
- func (list *UintList) DoDeleteAt(index, n int) *UintList
- func (list *UintList) DoDeleteFirst(n int) *UintList
- func (list *UintList) DoDeleteLast(n int) *UintList
- func (list *UintList) DoInsertAt(index int, more ...uint) *UintList
- func (list *UintList) DoKeepWhere(p func(uint) bool) *UintList
- func (list *UintList) DoReverse() *UintList
- func (list *UintList) DoShuffle() *UintList
- func (list *UintList) Drop(n int) *UintList
- func (list *UintList) DropLast(n int) *UintList
- func (list *UintList) DropWhile(p func(uint) bool) *UintList
- func (list *UintList) Equals(other *UintList) bool
- func (list *UintList) Exists(p func(uint) bool) bool
- func (list *UintList) Filter(p func(uint) bool) *UintList
- func (list *UintList) Find(p func(uint) bool) (uint, bool)
- func (list *UintList) FlatMap(f func(uint) []uint) *UintList
- func (list *UintList) FlatMapToString(f func(uint) []string) []string
- func (list *UintList) Fold(initial uint, fn func(uint, uint) uint) uint
- func (list *UintList) Forall(p func(uint) bool) bool
- func (list *UintList) Foreach(f func(uint))
- func (list *UintList) Get(i int) uint
- func (list *UintList) GobDecode(b []byte) error
- func (list UintList) GobEncode() ([]byte, error)
- func (list *UintList) Head() uint
- func (list *UintList) HeadOption() (uint, bool)
- func (list *UintList) IndexWhere(p func(uint) bool) int
- func (list *UintList) IndexWhere2(p func(uint) bool, from int) int
- func (list *UintList) Init() *UintList
- func (list *UintList) IsEmpty() bool
- func (list *UintList) IsSequence() bool
- func (list *UintList) IsSet() bool
- func (list *UintList) Last() uint
- func (list *UintList) LastIndexWhere(p func(uint) bool) int
- func (list *UintList) LastIndexWhere2(p func(uint) bool, before int) int
- func (list *UintList) LastOption() (uint, bool)
- func (list *UintList) Len() int
- func (list *UintList) Map(f func(uint) uint) *UintList
- func (list *UintList) MapToString(f func(uint) string) []string
- func (list UintList) MarshalJSON() ([]byte, error)
- func (list *UintList) Max() (result uint)
- func (list *UintList) MaxBy(less func(uint, uint) bool) uint
- func (list *UintList) Min() uint
- func (list *UintList) MinBy(less func(uint, uint) bool) uint
- func (list *UintList) MkString(sep string) string
- func (list *UintList) MkString3(before, between, after string) string
- func (list *UintList) NonEmpty() bool
- func (list *UintList) Partition(p func(uint) bool) (*UintList, *UintList)
- func (list *UintList) Reverse() *UintList
- func (list *UintList) Send() <-chan uint
- func (list *UintList) Shuffle() *UintList
- func (list *UintList) Size() int
- func (list *UintList) SortBy(less func(i, j uint) bool) *UintList
- func (list *UintList) Sorted() *UintList
- func (list *UintList) StableSortBy(less func(i, j uint) bool) *UintList
- func (list *UintList) StableSorted() *UintList
- func (list *UintList) String() string
- func (list *UintList) StringList() []string
- func (list *UintList) Sum() uint
- func (list *UintList) Swap(i, j int)
- func (list *UintList) Tail() *UintList
- func (list *UintList) Take(n int) *UintList
- func (list *UintList) TakeLast(n int) *UintList
- func (list *UintList) TakeWhile(p func(uint) bool) *UintList
- func (list *UintList) ToInterfaceSlice() []interface{}
- func (list *UintList) ToList() *UintList
- func (list *UintList) ToSet() *UintSet
- func (list *UintList) ToSlice() []uint
- func (list *UintList) UnmarshalJSON(b []byte) error
- type UintMkStringer
- type UintQueue
- func (queue *UintQueue) Add(more ...uint)
- func (queue *UintQueue) Cap() int
- func (queue *UintQueue) Clear()
- func (queue *UintQueue) Clone() *UintQueue
- func (queue *UintQueue) Contains(v uint) bool
- func (queue *UintQueue) ContainsAll(i ...uint) bool
- func (queue *UintQueue) CountBy(p func(uint) bool) (result int)
- func (queue *UintQueue) DoKeepWhere(p func(uint) bool) *UintQueue
- func (queue *UintQueue) Equals(other *UintQueue) bool
- func (queue *UintQueue) Exists(p func(uint) bool) bool
- func (queue *UintQueue) Filter(p func(uint) bool) *UintQueue
- func (queue *UintQueue) Find(p func(uint) bool) (uint, bool)
- func (queue *UintQueue) FlatMap(f func(uint) []uint) *UintQueue
- func (queue *UintQueue) FlatMapToString(f func(uint) []string) []string
- func (queue *UintQueue) Fold(initial uint, fn func(uint, uint) uint) uint
- func (queue *UintQueue) Forall(p func(uint) bool) bool
- func (queue *UintQueue) Foreach(f func(uint))
- func (queue *UintQueue) Get(i int) uint
- func (queue *UintQueue) Head() uint
- func (queue *UintQueue) HeadOption() (uint, bool)
- func (queue *UintQueue) IsEmpty() bool
- func (queue *UintQueue) IsFull() bool
- func (queue *UintQueue) IsOverwriting() bool
- func (queue *UintQueue) IsSequence() bool
- func (queue *UintQueue) IsSet() bool
- func (queue *UintQueue) Last() uint
- func (queue *UintQueue) LastOption() (uint, bool)
- func (queue *UintQueue) Len() int
- func (queue *UintQueue) Less(i, j int) bool
- func (queue *UintQueue) Map(f func(uint) uint) *UintQueue
- func (queue *UintQueue) MapToString(f func(uint) string) []string
- func (queue UintQueue) MarshalJSON() ([]byte, error)
- func (queue *UintQueue) Max() (result uint)
- func (queue *UintQueue) MaxBy(less func(uint, uint) bool) uint
- func (queue *UintQueue) Min() uint
- func (queue *UintQueue) MinBy(less func(uint, uint) bool) uint
- func (queue *UintQueue) MkString(sep string) string
- func (queue *UintQueue) MkString3(before, between, after string) string
- func (queue *UintQueue) NonEmpty() bool
- func (queue *UintQueue) Offer(items ...uint) []uint
- func (queue *UintQueue) Partition(p func(uint) bool) (*UintQueue, *UintQueue)
- func (queue *UintQueue) Pop(n int) []uint
- func (queue *UintQueue) Pop1() (uint, bool)
- func (queue *UintQueue) Push(items ...uint) *UintQueue
- func (queue *UintQueue) Reallocate(capacity int, overwrite bool) *UintQueue
- func (queue *UintQueue) Send() <-chan uint
- func (queue *UintQueue) Size() int
- func (queue *UintQueue) Sort()
- func (queue *UintQueue) Space() int
- func (queue *UintQueue) StableSort()
- func (queue *UintQueue) String() string
- func (queue *UintQueue) StringList() []string
- func (queue *UintQueue) Sum() uint
- func (queue *UintQueue) Swap(i, j int)
- func (queue *UintQueue) ToInterfaceSlice() []interface{}
- func (queue *UintQueue) ToList() *UintList
- func (queue *UintQueue) ToSet() *UintSet
- func (queue *UintQueue) ToSlice() []uint
- func (queue *UintQueue) UnmarshalJSON(b []byte) error
- type UintSequence
- type UintSet
- func (set *UintSet) Add(more ...uint)
- func (set *UintSet) Cardinality() int
- func (set *UintSet) Clear()
- func (set *UintSet) Clone() *UintSet
- func (set *UintSet) Contains(i uint) bool
- func (set *UintSet) ContainsAll(i ...uint) bool
- func (set *UintSet) CountBy(p func(uint) bool) (result int)
- func (set *UintSet) Difference(other *UintSet) *UintSet
- func (set *UintSet) Equals(other *UintSet) bool
- func (set *UintSet) Exists(p func(uint) bool) bool
- func (set *UintSet) Filter(p func(uint) bool) *UintSet
- func (set *UintSet) Find(p func(uint) bool) (uint, bool)
- func (set *UintSet) FlatMap(f func(uint) []uint) *UintSet
- func (set *UintSet) FlatMapToString(f func(uint) []string) []string
- func (set *UintSet) Fold(initial uint, fn func(uint, uint) uint) uint
- func (set *UintSet) Forall(p func(uint) bool) bool
- func (set *UintSet) Foreach(f func(uint))
- func (set *UintSet) GobDecode(b []byte) error
- func (set UintSet) GobEncode() ([]byte, error)
- func (set *UintSet) Intersect(other *UintSet) *UintSet
- func (set *UintSet) IsEmpty() bool
- func (set *UintSet) IsSequence() bool
- func (set *UintSet) IsSet() bool
- func (set *UintSet) IsSubset(other *UintSet) bool
- func (set *UintSet) IsSuperset(other *UintSet) bool
- func (set *UintSet) Map(f func(uint) uint) *UintSet
- func (set *UintSet) MapToString(f func(uint) string) []string
- func (set *UintSet) MarshalJSON() ([]byte, error)
- func (set *UintSet) Max() (result uint)
- func (set *UintSet) MaxBy(less func(uint, uint) bool) uint
- func (set *UintSet) Min() uint
- func (set *UintSet) MinBy(less func(uint, uint) bool) uint
- func (set *UintSet) MkString(sep string) string
- func (set *UintSet) MkString3(before, between, after string) string
- func (set *UintSet) NonEmpty() bool
- func (set *UintSet) Partition(p func(uint) bool) (*UintSet, *UintSet)
- func (set *UintSet) Remove(i uint)
- func (set *UintSet) Send() <-chan uint
- func (set *UintSet) Size() int
- func (set *UintSet) String() string
- func (set *UintSet) StringList() []string
- func (set *UintSet) StringMap() map[string]bool
- func (set *UintSet) Sum() uint
- func (set *UintSet) SymmetricDifference(other *UintSet) *UintSet
- func (set *UintSet) ToInterfaceSlice() []interface{}
- func (set *UintSet) ToList() *UintList
- func (set *UintSet) ToSet() *UintSet
- func (set *UintSet) ToSlice() []uint
- func (set *UintSet) Union(other *UintSet) *UintSet
- func (set *UintSet) UnmarshalJSON(b []byte) error
- type UintSizer
- type UintStringMap
- func (mm *UintStringMap) Clear()
- func (mm *UintStringMap) Clone() *UintStringMap
- func (mm *UintStringMap) ContainsAllKeys(kk ...uint) bool
- func (mm *UintStringMap) ContainsKey(k uint) bool
- func (mm *UintStringMap) DropWhere(fn func(uint, string) bool) UintStringTuples
- func (mm *UintStringMap) Equals(other *UintStringMap) bool
- func (mm *UintStringMap) Exists(p func(uint, string) bool) bool
- func (mm *UintStringMap) Filter(p func(uint, string) bool) *UintStringMap
- func (mm *UintStringMap) Find(p func(uint, string) bool) (UintStringTuple, bool)
- func (mm *UintStringMap) FlatMap(f func(uint, string) []UintStringTuple) *UintStringMap
- func (mm *UintStringMap) Forall(p func(uint, string) bool) bool
- func (mm *UintStringMap) Foreach(f func(uint, string))
- func (mm *UintStringMap) Get(k uint) (string, bool)
- func (mm *UintStringMap) GobDecode(b []byte) error
- func (mm *UintStringMap) GobEncode() ([]byte, error)
- func (mm *UintStringMap) IsEmpty() bool
- func (mm *UintStringMap) Keys() collection.UintList
- func (mm *UintStringMap) Map(f func(uint, string) (uint, string)) *UintStringMap
- func (mm *UintStringMap) MkString(sep string) string
- func (mm *UintStringMap) MkString4(before, between, after, equals string) string
- func (mm *UintStringMap) NonEmpty() bool
- func (mm *UintStringMap) OrderedSlice(keys collection.UintList) UintStringTuples
- func (mm *UintStringMap) Partition(p func(uint, string) bool) (matching *UintStringMap, others *UintStringMap)
- func (mm *UintStringMap) Pop(k uint) (string, bool)
- func (mm *UintStringMap) Put(k uint, v string) bool
- func (mm *UintStringMap) Remove(k uint)
- func (mm *UintStringMap) Size() int
- func (mm *UintStringMap) String() string
- func (mm *UintStringMap) ToSlice() UintStringTuples
- func (mm *UintStringMap) Values() collection.StringList
- type UintStringTuple
- type UintStringTuples
- func (ts UintStringTuples) Append1(k uint, v string) UintStringTuples
- func (ts UintStringTuples) Append2(k1 uint, v1 string, k2 uint, v2 string) UintStringTuples
- func (ts UintStringTuples) Append3(k1 uint, v1 string, k2 uint, v2 string, k3 uint, v3 string) UintStringTuples
- func (ts UintStringTuples) MkString(sep string) string
- func (ts UintStringTuples) MkString4(before, between, after, equals string) string
- func (ts UintStringTuples) String() string
- func (ts UintStringTuples) ToMap() *UintStringMap
- func (ts UintStringTuples) Values(values ...string) UintStringTuples
- type UintUintMap
- func (mm *UintUintMap) Clear()
- func (mm *UintUintMap) Clone() *UintUintMap
- func (mm *UintUintMap) ContainsAllKeys(kk ...uint) bool
- func (mm *UintUintMap) ContainsKey(k uint) bool
- func (mm *UintUintMap) DropWhere(fn func(uint, uint) bool) UintUintTuples
- func (mm *UintUintMap) Equals(other *UintUintMap) bool
- func (mm *UintUintMap) Exists(p func(uint, uint) bool) bool
- func (mm *UintUintMap) Filter(p func(uint, uint) bool) *UintUintMap
- func (mm *UintUintMap) Find(p func(uint, uint) bool) (UintUintTuple, bool)
- func (mm *UintUintMap) FlatMap(f func(uint, uint) []UintUintTuple) *UintUintMap
- func (mm *UintUintMap) Forall(p func(uint, uint) bool) bool
- func (mm *UintUintMap) Foreach(f func(uint, uint))
- func (mm *UintUintMap) Get(k uint) (uint, bool)
- func (mm *UintUintMap) GobDecode(b []byte) error
- func (mm *UintUintMap) GobEncode() ([]byte, error)
- func (mm *UintUintMap) IsEmpty() bool
- func (mm *UintUintMap) Keys() collection.UintList
- func (mm *UintUintMap) Map(f func(uint, uint) (uint, uint)) *UintUintMap
- func (mm *UintUintMap) MkString(sep string) string
- func (mm *UintUintMap) MkString4(before, between, after, equals string) string
- func (mm *UintUintMap) NonEmpty() bool
- func (mm *UintUintMap) OrderedSlice(keys collection.UintList) UintUintTuples
- func (mm *UintUintMap) Partition(p func(uint, uint) bool) (matching *UintUintMap, others *UintUintMap)
- func (mm *UintUintMap) Pop(k uint) (uint, bool)
- func (mm *UintUintMap) Put(k uint, v uint) bool
- func (mm *UintUintMap) Remove(k uint)
- func (mm *UintUintMap) Size() int
- func (mm *UintUintMap) String() string
- func (mm *UintUintMap) ToSlice() UintUintTuples
- func (mm *UintUintMap) Values() collection.UintList
- type UintUintTuple
- type UintUintTuples
- func (ts UintUintTuples) Append1(k uint, v uint) UintUintTuples
- func (ts UintUintTuples) Append2(k1 uint, v1 uint, k2 uint, v2 uint) UintUintTuples
- func (ts UintUintTuples) Append3(k1 uint, v1 uint, k2 uint, v2 uint, k3 uint, v3 uint) UintUintTuples
- func (ts UintUintTuples) MkString(sep string) string
- func (ts UintUintTuples) MkString4(before, between, after, equals string) string
- func (ts UintUintTuples) String() string
- func (ts UintUintTuples) ToMap() *UintUintMap
- func (ts UintUintTuples) Values(values ...uint) UintUintTuples
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyCollection ¶
type AnyCollection interface { AnySizer AnyMkStringer // IsSequence returns true for lists and queues. IsSequence() bool // IsSet returns false for lists and queues. IsSet() bool // ToSlice returns a shallow copy as a plain slice. ToSlice() []interface{} // ToInterfaceSlice returns a shallow copy as a slice of arbitrary type. ToInterfaceSlice() []interface{} // Exists verifies that one or more elements of AnyCollection return true for the predicate p. Exists(p func(interface{}) bool) bool // Forall verifies that all elements of AnyCollection return true for the predicate p. Forall(p func(interface{}) bool) bool // Foreach iterates over AnyCollection and executes the function f against each element. Foreach(f func(interface{})) // Find returns the first interface{} that returns true for the predicate p. // False is returned if none match. Find(p func(interface{}) bool) (interface{}, bool) // Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example. // A goroutine is created to send the elements; this only terminates when all the elements have been consumed Send() <-chan interface{} // CountBy gives the number elements of AnyCollection that return true for the predicate p. CountBy(p func(interface{}) bool) int // Contains determines whether a given item is already in the collection, returning true if so. Contains(v interface{}) bool // ContainsAll determines whether the given items are all in the collection, returning true if so. ContainsAll(v ...interface{}) bool // Clear the entire collection. Clear() // Add adds items to the current collection. Add(more ...interface{}) // MinBy returns an element of AnyCollection containing the minimum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such // element is returned. Panics if there are no elements. MinBy(less func(interface{}, interface{}) bool) interface{} // MaxBy returns an element of AnyCollection containing the maximum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such // element is returned. Panics if there are no elements. MaxBy(less func(interface{}, interface{}) bool) interface{} // Fold aggregates all the values in the collection using a supplied function, starting from some initial value. Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{} }
AnyCollection defines an interface for common collection methods on interface{}.
type AnyList ¶
type AnyList struct {
// contains filtered or unexported fields
}
AnyList contains a slice of type interface{}. It encapsulates the slice and provides methods to access or mutate it.
List values follow a similar pattern to Scala Lists and LinearSeqs in particular. For comparison with Scala, see e.g. http://www.scala-lang.org/api/2.11.7/#scala.collection.LinearSeq
func BuildAnyListFromChan ¶
func BuildAnyListFromChan(source <-chan interface{}) *AnyList
BuildAnyListFromChan constructs a new AnyList from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertAnyList ¶
ConvertAnyList constructs a new list containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned list will contain all the values that were correctly converted.
func MakeAnyList ¶
MakeAnyList makes an empty list with both length and capacity initialised.
func NewAnyList ¶
func NewAnyList(values ...interface{}) *AnyList
NewAnyList constructs a new list containing the supplied values, if any.
func (*AnyList) Add ¶
func (list *AnyList) Add(more ...interface{})
Add adds items to the current list. This is a synonym for Append.
func (*AnyList) Append ¶
Append adds items to the current list. If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned.
func (*AnyList) Clone ¶
Clone returns a shallow copy of the list. It does not clone the underlying elements.
func (*AnyList) Contains ¶
Contains determines whether a given item is already in the list, returning true if so.
func (*AnyList) ContainsAll ¶
ContainsAll determines whether the given items are all in the list, returning true if so. This is potentially a slow method and should only be used rarely.
func (*AnyList) CountBy ¶
CountBy gives the number elements of AnyList that return true for the predicate p.
func (*AnyList) DistinctBy ¶
DistinctBy returns a new AnyList whose elements are unique, where equality is defined by the equal function.
func (*AnyList) DoDeleteAt ¶
DoDeleteAt modifies a AnyList by deleting n elements from a given index.
The list is modified and the modified list is returned. Panics if the index is out of range or n is large enough to take the index out of range.
func (*AnyList) DoDeleteFirst ¶
DoDeleteFirst modifies a AnyList by deleting n elements from the start of the list.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if n is large enough to take the index out of range.
func (*AnyList) DoDeleteLast ¶
DoDeleteLast modifies a AnyList by deleting n elements from the end of the list.
The list is modified and the modified list is returned. Panics if n is large enough to take the index out of range.
func (*AnyList) DoInsertAt ¶
DoInsertAt modifies a AnyList by inserting elements at a given index. This is a generalised version of Append.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if the index is out of range.
func (*AnyList) DoKeepWhere ¶
DoKeepWhere modifies a AnyList by retaining only those elements that match the predicate p. This is very similar to Filter but alters the list in place.
The list is modified and the modified list is returned.
func (*AnyList) DoReverse ¶
DoReverse alters a AnyList with all elements in the reverse order. Unlike Reverse, it does not allocate new memory.
The list is modified and the modified list is returned.
func (*AnyList) DoShuffle ¶
DoShuffle returns a shuffled AnyList, using a version of the Fisher-Yates shuffle.
The list is modified and the modified list is returned.
func (*AnyList) Drop ¶
Drop returns a slice of AnyList without the leading n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*AnyList) DropLast ¶
DropLast returns a slice of AnyList without the trailing n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*AnyList) DropWhile ¶
DropWhile returns a new AnyList containing the trailing elements of the source list. Whilst the predicate p returns true, elements are excluded from the result. Once predicate p returns false, all remaining elements are added.
The original list is not modified.
func (*AnyList) Equals ¶
Equals determines if two lists are equal to each other. If they both are the same size and have the same items in the same order, they are considered equal. Order of items is not relevent for sets to be equal. Nil lists are considered to be empty.
func (*AnyList) Exists ¶
Exists verifies that one or more elements of AnyList return true for the predicate p.
func (*AnyList) Filter ¶
Filter returns a new AnyList whose elements return true for predicate p.
The original list is not modified. See also DoKeepWhere (which does modify the original list).
func (*AnyList) Find ¶
Find returns the first interface{} that returns true for predicate p. False is returned if none match.
func (*AnyList) FlatMap ¶
FlatMap returns a new AnyList by transforming every element with function f that returns zero or more items in a slice. The resulting list may have a different size to the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*AnyList) Fold ¶ added in v0.9.0
func (list *AnyList) Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{}
Fold aggregates all the values in the list using a supplied function, starting from some initial value.
func (*AnyList) Forall ¶
Forall verifies that all elements of AnyList return true for the predicate p.
func (*AnyList) Foreach ¶
func (list *AnyList) Foreach(f func(interface{}))
Foreach iterates over AnyList and executes function f against each element. The function can safely alter the values via side-effects.
func (*AnyList) Get ¶
Get gets the specified element in the list. Panics if the index is out of range or the list is nil.
func (*AnyList) GobDecode ¶
GobDecode implements 'gob' decoding for this list type. You must register interface{} with the 'gob' package before this method is used.
func (AnyList) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register interface{} with the 'gob' package before this method is used.
func (*AnyList) Head ¶
func (list *AnyList) Head() interface{}
Head gets the first element in the list. Head plus Tail include the whole list. Head is the opposite of Last. Panics if list is empty or nil.
func (*AnyList) HeadOption ¶
HeadOption gets the first element in the list, if possible. Otherwise returns the zero value.
func (*AnyList) IndexWhere ¶
IndexWhere finds the index of the first element satisfying predicate p. If none exists, -1 is returned.
func (*AnyList) IndexWhere2 ¶
IndexWhere2 finds the index of the first element satisfying predicate p at or after some start index. If none exists, -1 is returned.
func (*AnyList) Init ¶
Init gets everything except the last. Init plus Last include the whole list. Init is the opposite of Tail. Panics if list is empty or nil.
func (*AnyList) IsSequence ¶
IsSequence returns true for lists and queues.
func (*AnyList) Last ¶
func (list *AnyList) Last() interface{}
Last gets the last element in the list. Init plus Last include the whole list. Last is the opposite of Head. Panics if list is empty or nil.
func (*AnyList) LastIndexWhere ¶
LastIndexWhere finds the index of the last element satisfying predicate p. If none exists, -1 is returned.
func (*AnyList) LastIndexWhere2 ¶
LastIndexWhere2 finds the index of the last element satisfying predicate p at or before some start index. If none exists, -1 is returned.
func (*AnyList) LastOption ¶
LastOption gets the last element in the list, if possible. Otherwise returns the zero value.
func (*AnyList) Len ¶
Len returns the number of items in the list - an alias of Size(). This is one of the three methods in the standard sort.Interface.
func (*AnyList) Map ¶
Map returns a new AnyList by transforming every element with function f. The resulting list is the same size as the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (AnyList) MarshalJSON ¶
MarshalJSON implements JSON encoding for this list type.
func (*AnyList) MaxBy ¶
MaxBy returns an element of AnyList containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*AnyList) MinBy ¶
MinBy returns an element of AnyList containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*AnyList) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*AnyList) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*AnyList) Partition ¶
Partition returns two new AnyLists whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original list is not modified
func (*AnyList) Reverse ¶
Reverse returns a copy of AnyList with all elements in the reverse order.
The original list is not modified.
func (*AnyList) Send ¶
func (list *AnyList) Send() <-chan interface{}
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*AnyList) Shuffle ¶
Shuffle returns a shuffled copy of AnyList, using a version of the Fisher-Yates shuffle.
The original list is not modified.
func (*AnyList) SortBy ¶
SortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned.
func (*AnyList) StableSortBy ¶
StableSortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned. The algorithm keeps the original order of equal elements.
func (*AnyList) String ¶
String implements the Stringer interface to render the list as a comma-separated string enclosed in square brackets.
func (*AnyList) StringList ¶
StringList gets a list of strings that depicts all the elements.
func (*AnyList) Swap ¶
Swap exchanges two elements, which is necessary during sorting etc. This is one of the three methods in the standard sort.Interface.
func (*AnyList) Tail ¶
Tail gets everything except the head. Head plus Tail include the whole list. Tail is the opposite of Init. Panics if list is empty or nil.
func (*AnyList) Take ¶
Take returns a slice of AnyList containing the leading n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
func (*AnyList) TakeLast ¶
TakeLast returns a slice of AnyList containing the trailing n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
The original list is not modified.
func (*AnyList) TakeWhile ¶
TakeWhile returns a new AnyList containing the leading elements of the source list. Whilst the predicate p returns true, elements are added to the result. Once predicate p returns false, all remaining elements are excluded.
The original list is not modified.
func (*AnyList) ToInterfaceSlice ¶
func (list *AnyList) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current list as a slice of arbitrary type.
func (*AnyList) ToList ¶
ToList returns the elements of the list as a list, which is an identity operation in this case.
func (*AnyList) ToSet ¶
ToSet returns the elements of the list as a set. The returned set is a shallow copy; the list is not altered.
func (*AnyList) ToSlice ¶
func (list *AnyList) ToSlice() []interface{}
ToSlice returns the elements of the current list as a slice.
func (*AnyList) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this list type.
type AnyMkStringer ¶
type AnyMkStringer interface { // String implements the Stringer interface to render the collection as a comma-separated string enclosed // in square brackets. String() string // MkString concatenates the values as a string using a supplied separator. No enclosing marks are added. MkString(sep string) string // MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied. MkString3(before, between, after string) string // implements json.Marshaler interface { MarshalJSON() ([]byte, error) // implements json.Unmarshaler interface { UnmarshalJSON(b []byte) error // StringList gets a collection of strings that depicts all the elements. StringList() []string }
AnyMkStringer defines an interface for stringer methods on interface{} collections.
type AnyQueue ¶ added in v0.8.0
type AnyQueue struct {
// contains filtered or unexported fields
}
AnyQueue is a ring buffer containing a slice of type interface{}. It is optimised for FIFO operations.
func BuildAnyQueueFromChan ¶ added in v0.8.0
func BuildAnyQueueFromChan(source <-chan interface{}) *AnyQueue
BuildAnyQueueFromChan constructs a new AnyQueue from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func NewAnyQueue ¶ added in v0.8.0
NewAnyQueue returns a new queue of interface{}. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue.
func NewAnySortedQueue ¶ added in v0.8.0
NewAnySortedQueue returns a new queue of interface{}. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue. If the 'less' comparison function is not nil, elements can be easily sorted.
func (*AnyQueue) Add ¶ added in v0.8.0
func (queue *AnyQueue) Add(more ...interface{})
Add adds items to the queue. This is a synonym for Push.
func (*AnyQueue) Clone ¶ added in v0.8.0
Clone returns a shallow copy of the queue. It does not clone the underlying elements.
func (*AnyQueue) Contains ¶ added in v0.8.0
Contains determines whether a given item is already in the queue, returning true if so.
func (*AnyQueue) ContainsAll ¶ added in v0.8.0
ContainsAll determines whether the given items are all in the queue, returning true if so. This is potentially a slow method and should only be used rarely.
func (*AnyQueue) CountBy ¶ added in v0.8.0
CountBy gives the number elements of AnyQueue that return true for the predicate p.
func (*AnyQueue) DoKeepWhere ¶ added in v0.8.0
DoKeepWhere modifies a AnyQueue by retaining only those elements that match the predicate p. This is very similar to Filter but alters the queue in place.
The queue is modified and the modified queue is returned.
func (*AnyQueue) Equals ¶ added in v0.8.0
Equals determines if two queues are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal. Nil queues are considered to be empty.
func (*AnyQueue) Exists ¶ added in v0.8.0
Exists verifies that one or more elements of AnyQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*AnyQueue) Filter ¶ added in v0.8.0
Filter returns a new AnyQueue whose elements return true for predicate p.
The original queue is not modified. See also DoKeepWhere (which does modify the original queue).
func (*AnyQueue) Find ¶ added in v0.8.0
Find returns the first interface{} that returns true for predicate p. False is returned if none match.
func (*AnyQueue) FlatMap ¶ added in v0.8.0
FlatMap returns a new AnyQueue by transforming every element with function f that returns zero or more items in a slice. The resulting queue may have a different size to the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*AnyQueue) Fold ¶ added in v0.9.0
func (queue *AnyQueue) Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{}
Fold aggregates all the values in the queue using a supplied function, starting from some initial value.
func (*AnyQueue) Forall ¶ added in v0.8.0
Forall verifies that all elements of AnyQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*AnyQueue) Foreach ¶ added in v0.8.0
func (queue *AnyQueue) Foreach(f func(interface{}))
Foreach iterates over AnyQueue and executes function f against each element. The function can safely alter the values via side-effects.
func (*AnyQueue) Get ¶ added in v0.8.0
Get gets the specified element in the queue. Panics if the index is out of range or the queue is nil.
func (*AnyQueue) Head ¶ added in v0.8.0
func (queue *AnyQueue) Head() interface{}
Head gets the first element in the queue. Head is the opposite of Last. Panics if queue is empty or nil.
func (*AnyQueue) HeadOption ¶ added in v0.8.0
HeadOption returns the oldest item in the queue without removing it. If the queue is nil or empty, it returns the zero value instead.
func (*AnyQueue) IsOverwriting ¶ added in v0.8.0
IsOverwriting returns true if the queue is overwriting, false if refusing.
func (*AnyQueue) IsSequence ¶ added in v0.8.0
IsSequence returns true for ordered lists and queues.
func (*AnyQueue) Last ¶ added in v0.8.0
func (queue *AnyQueue) Last() interface{}
Last gets the the newest item in the queue (i.e. last element pushed) without removing it. Last is the opposite of Head. Panics if queue is empty or nil.
func (*AnyQueue) LastOption ¶ added in v0.8.0
LastOption returns the newest item in the queue without removing it. If the queue is nil empty, it returns the zero value instead.
func (*AnyQueue) Len ¶ added in v0.8.0
Len gets the current length of this queue. This is an alias for Size.
func (*AnyQueue) Less ¶ added in v0.8.0
Less reports whether the element with index i should sort before the element with index j. The queue must have been created with a non-nil 'less' comparison function and it must not be empty.
func (*AnyQueue) Map ¶ added in v0.8.0
Map returns a new AnyQueue by transforming every element with function f. The resulting queue is the same size as the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (AnyQueue) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements JSON encoding for this queue type.
func (*AnyQueue) MaxBy ¶ added in v0.8.0
MaxBy returns an element of AnyQueue containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*AnyQueue) MinBy ¶ added in v0.8.0
MinBy returns an element of AnyQueue containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*AnyQueue) MkString ¶ added in v0.8.0
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*AnyQueue) MkString3 ¶ added in v0.8.0
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*AnyQueue) Offer ¶ added in v0.8.0
func (queue *AnyQueue) Offer(items ...interface{}) []interface{}
Offer appends as many items to the end of the queue as it can. If the queue is already full, what happens depends on whether the queue is configured to overwrite. If it is, the oldest items will be overwritten. Otherwise, it will be filled to capacity and any unwritten items are returned.
If the capacity is too small for the number of items, the excess items are returned. The queue capacity is never altered.
func (*AnyQueue) Partition ¶ added in v0.8.0
Partition returns two new AnyQueues whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original queue.
The original queue is not modified
func (*AnyQueue) Pop ¶ added in v0.8.0
Pop removes and returns the oldest items from the queue. If the queue is empty, it returns a nil slice. If n is larger than the current queue length, it returns all the available elements, so in this case the returned slice will be shorter than n.
func (*AnyQueue) Pop1 ¶ added in v0.8.0
Pop1 removes and returns the oldest item from the queue. If the queue is empty, it returns the zero value instead. The boolean is true only if the element was available.
func (*AnyQueue) Push ¶ added in v0.8.0
Push appends items to the end of the queue. If the queue does not have enough space, more will be allocated: how this happens depends on the overwriting mode.
When overwriting, the oldest items are overwritten with the new data; it expands the queue only if there is still not enough space.
Otherwise, the queue might be reallocated if necessary, ensuring that all the data is pushed without any older items being affected.
The modified queue is returned.
func (*AnyQueue) Reallocate ¶ added in v0.8.0
Reallocate adjusts the allocated capacity of the queue and allows the overwriting behaviour to be changed.
If the new queue capacity is different to the current capacity, the queue is re-allocated to the new capacity. If this is less than the current number of elements, the oldest items in the queue are discarded so that the remaining data can fit in the new space available.
If the new queue capacity is the same as the current capacity, the queue is not altered except for adopting the new overwrite flag's value. Therefore this is the means to change the overwriting behaviour.
Reallocate adjusts the storage space but does not clone the underlying elements.
The queue must not be nil.
func (*AnyQueue) Send ¶ added in v0.8.0
func (queue *AnyQueue) Send() <-chan interface{}
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*AnyQueue) Size ¶ added in v0.8.0
Size gets the number of elements currently in this queue. This is an alias for Len.
func (*AnyQueue) Sort ¶ added in v0.8.0
func (queue *AnyQueue) Sort()
Sort sorts the queue using the 'less' comparison function, which must not be nil. This function will panic if the collection was created with a nil 'less' function (see NewAnySortedQueue).
func (*AnyQueue) StableSort ¶ added in v0.8.0
func (queue *AnyQueue) StableSort()
StableSort sorts the queue using the 'less' comparison function, which must not be nil. The result is stable so that repeated calls will not arbitrarily swap equal items. This function will panic if the collection was created with a nil 'less' function (see NewAnySortedQueue).
func (*AnyQueue) String ¶ added in v0.8.0
String implements the Stringer interface to render the queue as a comma-separated string enclosed in square brackets.
func (*AnyQueue) StringList ¶ added in v0.8.0
StringList gets a list of strings that depicts all the elements.
func (*AnyQueue) Swap ¶ added in v0.8.0
Swap swaps the elements with indexes i and j. The queue must not be empty.
func (*AnyQueue) ToInterfaceSlice ¶ added in v0.8.0
func (queue *AnyQueue) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the queue as a slice of arbitrary type. The queue is not altered.
func (*AnyQueue) ToList ¶ added in v0.9.0
ToList returns the elements of the queue as a list. The returned list is a shallow copy; the queue is not altered.
func (*AnyQueue) ToSet ¶ added in v0.8.0
ToSet returns the elements of the queue as a set. The returned set is a shallow copy; the queue is not altered.
func (*AnyQueue) ToSlice ¶ added in v0.8.0
func (queue *AnyQueue) ToSlice() []interface{}
ToSlice returns the elements of the queue as a slice. The queue is not altered.
func (*AnyQueue) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements JSON decoding for this queue type.
type AnySequence ¶ added in v0.9.0
type AnySequence interface { AnyCollection // Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last. Head() interface{} // HeadOption gets the first element in the sequence, if possible. HeadOption() (interface{}, bool) // Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head. Last() interface{} // LastOption gets the last element in the sequence, if possible. LastOption() (interface{}, bool) }
AnySequence defines an interface for sequence methods on interface{}.
type AnySet ¶
type AnySet struct {
// contains filtered or unexported fields
}
AnySet is the primary type that represents a set.
func BuildAnySetFromChan ¶
func BuildAnySetFromChan(source <-chan interface{}) *AnySet
BuildAnySetFromChan constructs a new AnySet from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertAnySet ¶
ConvertAnySet constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned set will contain all the values that were correctly converted.
func NewAnySet ¶
func NewAnySet(values ...interface{}) *AnySet
NewAnySet creates and returns a reference to an empty set.
func (*AnySet) Cardinality ¶
Cardinality returns how many items are currently in the set. This is a synonym for Size.
func (*AnySet) Clear ¶
func (set *AnySet) Clear()
Clear the entire set. Aterwards, it will be an empty set.
func (*AnySet) Clone ¶
Clone returns a shallow copy of the set. It does not clone the underlying elements.
func (*AnySet) Contains ¶
Contains determines whether a given item is already in the set, returning true if so.
func (*AnySet) ContainsAll ¶
ContainsAll determines whether the given items are all in the set, returning true if so.
func (*AnySet) CountBy ¶
CountBy gives the number elements of AnySet that return true for the predicate p.
func (*AnySet) Difference ¶
Difference returns a new set with items in the current set but not in the other set
func (*AnySet) Equals ¶
Equals determines whether two sets are equal to each other, returning true if so. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (*AnySet) Exists ¶
Exists applies a predicate p to every element in the set. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*AnySet) Filter ¶
Filter returns a new AnySet whose elements return true for the predicate p.
The original set is not modified
func (*AnySet) Find ¶
Find returns the first interface{} that returns true for the predicate p. If there are many matches one is arbtrarily chosen. False is returned if none match.
func (*AnySet) FlatMap ¶
FlatMap returns a new AnySet by transforming every element with a function f that returns zero or more items in a slice. The resulting set may have a different size to the original set. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*AnySet) Fold ¶ added in v0.9.0
func (set *AnySet) Fold(initial interface{}, fn func(interface{}, interface{}) interface{}) interface{}
Fold aggregates all the values in the set using a supplied function, starting from some initial value.
func (*AnySet) Forall ¶
Forall applies a predicate function p to every element in the set. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*AnySet) Foreach ¶
func (set *AnySet) Foreach(f func(interface{}))
Foreach iterates over the set and executes the function f against each element. The function can safely alter the values via side-effects.
func (*AnySet) GobDecode ¶
GobDecode implements 'gob' decoding for this set type. You must register interface{} with the 'gob' package before this method is used.
func (AnySet) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register interface{} with the 'gob' package before this method is used.
func (*AnySet) IsSequence ¶
IsSequence returns true for lists and queues.
func (*AnySet) IsSubset ¶
IsSubset determines whether every item in the other set is in this set, returning true if so.
func (*AnySet) IsSuperset ¶
IsSuperset determines whether every item of this set is in the other set, returning true if so.
func (*AnySet) Map ¶
Map returns a new AnySet by transforming every element with a function f. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*AnySet) MarshalJSON ¶
MarshalJSON implements JSON encoding for this set type.
func (*AnySet) MaxBy ¶
MaxBy returns an element of AnySet containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*AnySet) MinBy ¶
MinBy returns an element of AnySet containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*AnySet) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*AnySet) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*AnySet) Partition ¶
Partition returns two new AnySets whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original set is not modified
func (*AnySet) Send ¶
func (set *AnySet) Send() <-chan interface{}
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed
func (*AnySet) Size ¶
Size returns how many items are currently in the set. This is a synonym for Cardinality.
func (*AnySet) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*AnySet) StringList ¶
StringSet gets a list of strings that depicts all the elements.
func (*AnySet) StringMap ¶
StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.
func (*AnySet) SymmetricDifference ¶
SymmetricDifference returns a new set with items in the current set or the other set but not in both.
func (*AnySet) ToInterfaceSlice ¶
func (set *AnySet) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.
func (*AnySet) ToList ¶
ToList returns the elements of the set as a list. The returned list is a shallow copy; the set is not altered.
func (*AnySet) ToSlice ¶
func (set *AnySet) ToSlice() []interface{}
ToSlice returns the elements of the current set as a slice.
func (*AnySet) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this set type.
type AnySizer ¶
type AnySizer interface { // IsEmpty tests whether AnyCollection is empty. IsEmpty() bool // NonEmpty tests whether AnyCollection is empty. NonEmpty() bool // Size returns the number of items in the collection - an alias of Len(). Size() int }
AnySizer defines an interface for sizing methods on interface{} collections.
type Int64Collection ¶
type Int64Collection interface { Int64Sizer Int64MkStringer // IsSequence returns true for lists and queues. IsSequence() bool // IsSet returns false for lists and queues. IsSet() bool // ToSlice returns a shallow copy as a plain slice. ToSlice() []int64 // ToInterfaceSlice returns a shallow copy as a slice of arbitrary type. ToInterfaceSlice() []interface{} // Exists verifies that one or more elements of Int64Collection return true for the predicate p. Exists(p func(int64) bool) bool // Forall verifies that all elements of Int64Collection return true for the predicate p. Forall(p func(int64) bool) bool // Foreach iterates over Int64Collection and executes the function f against each element. Foreach(f func(int64)) // Find returns the first int64 that returns true for the predicate p. // False is returned if none match. Find(p func(int64) bool) (int64, bool) // MapToString returns a new []string by transforming every element with function f. // The resulting slice is the same size as the collection. The collection is not modified. MapToString(f func(int64) string) []string // FlatMapString returns a new []string by transforming every element with function f // that returns zero or more items in a slice. The resulting slice may have a different size to the // collection. The collection is not modified. FlatMapToString(f func(int64) []string) []string // Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example. // A goroutine is created to send the elements; this only terminates when all the elements have been consumed Send() <-chan int64 // CountBy gives the number elements of Int64Collection that return true for the predicate p. CountBy(p func(int64) bool) int // Contains determines whether a given item is already in the collection, returning true if so. Contains(v int64) bool // ContainsAll determines whether the given items are all in the collection, returning true if so. ContainsAll(v ...int64) bool // Clear the entire collection. Clear() // Add adds items to the current collection. Add(more ...int64) // Min returns the minimum value of all the items in the collection. Panics if there are no elements. Min() int64 // Max returns the minimum value of all the items in the collection. Panics if there are no elements. Max() int64 // MinBy returns an element of Int64Collection containing the minimum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such // element is returned. Panics if there are no elements. MinBy(less func(int64, int64) bool) int64 // MaxBy returns an element of Int64Collection containing the maximum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such // element is returned. Panics if there are no elements. MaxBy(less func(int64, int64) bool) int64 // Fold aggregates all the values in the collection using a supplied function, starting from some initial value. Fold(initial int64, fn func(int64, int64) int64) int64 // Sum returns the sum of all the elements in the collection. Sum() int64 }
Int64Collection defines an interface for common collection methods on int64.
type Int64Int64Map ¶
type Int64Int64Map struct {
// contains filtered or unexported fields
}
Int64Int64Map is the primary type that represents a thread-safe map
func NewInt64Int64Map ¶
func NewInt64Int64Map(kv ...Int64Int64Tuple) *Int64Int64Map
NewInt64Int64Map creates and returns a reference to a map, optionally containing some items.
func NewInt64Int64Map1 ¶
func NewInt64Int64Map1(k int64, v int64) *Int64Int64Map
NewInt64Int64Map1 creates and returns a reference to a map containing one item.
func (*Int64Int64Map) Clone ¶
func (mm *Int64Int64Map) Clone() *Int64Int64Map
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*Int64Int64Map) ContainsAllKeys ¶
func (mm *Int64Int64Map) ContainsAllKeys(kk ...int64) bool
ContainsAllKeys determines if the given items are all in the map.
func (*Int64Int64Map) ContainsKey ¶
func (mm *Int64Int64Map) ContainsKey(k int64) bool
ContainsKey determines if a given item is already in the map.
func (*Int64Int64Map) DropWhere ¶
func (mm *Int64Int64Map) DropWhere(fn func(int64, int64) bool) Int64Int64Tuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*Int64Int64Map) Equals ¶
func (mm *Int64Int64Map) Equals(other *Int64Int64Map) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*Int64Int64Map) Exists ¶
func (mm *Int64Int64Map) Exists(p func(int64, int64) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*Int64Int64Map) Filter ¶
func (mm *Int64Int64Map) Filter(p func(int64, int64) bool) *Int64Int64Map
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*Int64Int64Map) Find ¶
func (mm *Int64Int64Map) Find(p func(int64, int64) bool) (Int64Int64Tuple, bool)
Find returns the first int64 that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*Int64Int64Map) FlatMap ¶
func (mm *Int64Int64Map) FlatMap(f func(int64, int64) []Int64Int64Tuple) *Int64Int64Map
FlatMap returns a new Int64Map by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Int64Map) Forall ¶
func (mm *Int64Int64Map) Forall(p func(int64, int64) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*Int64Int64Map) Foreach ¶
func (mm *Int64Int64Map) Foreach(f func(int64, int64))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*Int64Int64Map) Get ¶
func (mm *Int64Int64Map) Get(k int64) (int64, bool)
Get returns one of the items in the map, if present.
func (*Int64Int64Map) GobDecode ¶
func (mm *Int64Int64Map) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register int64 with the 'gob' package before this method is used.
func (*Int64Int64Map) GobEncode ¶
func (mm *Int64Int64Map) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register int64 with the 'gob' package before this method is used.
func (*Int64Int64Map) IsEmpty ¶
func (mm *Int64Int64Map) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*Int64Int64Map) Keys ¶
func (mm *Int64Int64Map) Keys() collection.Int64List
Keys returns the keys of the current map as a slice.
func (*Int64Int64Map) Map ¶
func (mm *Int64Int64Map) Map(f func(int64, int64) (int64, int64)) *Int64Int64Map
Map returns a new Int64Map by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Int64Map) MkString ¶
func (mm *Int64Int64Map) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*Int64Int64Map) MkString4 ¶ added in v0.7.0
func (mm *Int64Int64Map) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*Int64Int64Map) NonEmpty ¶
func (mm *Int64Int64Map) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*Int64Int64Map) OrderedSlice ¶
func (mm *Int64Int64Map) OrderedSlice(keys collection.Int64List) Int64Int64Tuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*Int64Int64Map) Partition ¶
func (mm *Int64Int64Map) Partition(p func(int64, int64) bool) (matching *Int64Int64Map, others *Int64Int64Map)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*Int64Int64Map) Pop ¶
func (mm *Int64Int64Map) Pop(k int64) (int64, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*Int64Int64Map) Put ¶
func (mm *Int64Int64Map) Put(k int64, v int64) bool
Put adds an item to the current map, replacing any prior value.
func (*Int64Int64Map) Remove ¶
func (mm *Int64Int64Map) Remove(k int64)
Remove a single item from the map.
func (*Int64Int64Map) Size ¶
func (mm *Int64Int64Map) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*Int64Int64Map) String ¶
func (mm *Int64Int64Map) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*Int64Int64Map) ToSlice ¶
func (mm *Int64Int64Map) ToSlice() Int64Int64Tuples
ToSlice returns the key/value pairs as a slice
func (*Int64Int64Map) Values ¶
func (mm *Int64Int64Map) Values() collection.Int64List
Values returns the values of the current map as a slice.
type Int64Int64Tuple ¶
Int64Int64Tuple represents a key/value pair.
func (Int64Int64Tuple) MarshalJSON ¶
func (t Int64Int64Tuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (Int64Int64Tuple) UnmarshalJSON ¶
func (t Int64Int64Tuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type Int64Int64Tuples ¶
type Int64Int64Tuples []Int64Int64Tuple
Int64Int64Tuples can be used as a builder for unmodifiable maps.
func Int64Int64Zip ¶
func Int64Int64Zip(keys ...int64) Int64Int64Tuples
Int64Int64Zip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewInt64Int64Map constructor function.
func (Int64Int64Tuples) Append1 ¶
func (ts Int64Int64Tuples) Append1(k int64, v int64) Int64Int64Tuples
Append1 adds one item.
func (Int64Int64Tuples) Append2 ¶
func (ts Int64Int64Tuples) Append2(k1 int64, v1 int64, k2 int64, v2 int64) Int64Int64Tuples
Append2 adds two items.
func (Int64Int64Tuples) Append3 ¶
func (ts Int64Int64Tuples) Append3(k1 int64, v1 int64, k2 int64, v2 int64, k3 int64, v3 int64) Int64Int64Tuples
Append3 adds three items.
func (Int64Int64Tuples) MkString ¶
func (ts Int64Int64Tuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (Int64Int64Tuples) MkString4 ¶ added in v0.7.0
func (ts Int64Int64Tuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (Int64Int64Tuples) String ¶
func (ts Int64Int64Tuples) String() string
func (Int64Int64Tuples) ToMap ¶
func (ts Int64Int64Tuples) ToMap() *Int64Int64Map
ToMap converts the tuples to a map.
func (Int64Int64Tuples) Values ¶
func (ts Int64Int64Tuples) Values(values ...int64) Int64Int64Tuples
Values sets the values in a tuple slice. Use this with Int64Int64Zip.
type Int64List ¶
type Int64List struct {
// contains filtered or unexported fields
}
Int64List contains a slice of type int64. It encapsulates the slice and provides methods to access or mutate it.
List values follow a similar pattern to Scala Lists and LinearSeqs in particular. For comparison with Scala, see e.g. http://www.scala-lang.org/api/2.11.7/#scala.collection.LinearSeq
func BuildInt64ListFromChan ¶
BuildInt64ListFromChan constructs a new Int64List from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertInt64List ¶
ConvertInt64List constructs a new list containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned list will contain all the values that were correctly converted. Conversions are provided from all built-in numeric types.
func MakeInt64List ¶
MakeInt64List makes an empty list with both length and capacity initialised.
func NewInt64List ¶
NewInt64List constructs a new list containing the supplied values, if any.
func (*Int64List) Append ¶
Append adds items to the current list. If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned.
func (*Int64List) Clone ¶
Clone returns a shallow copy of the list. It does not clone the underlying elements.
func (*Int64List) Contains ¶
Contains determines whether a given item is already in the list, returning true if so.
func (*Int64List) ContainsAll ¶
ContainsAll determines whether the given items are all in the list, returning true if so. This is potentially a slow method and should only be used rarely.
func (*Int64List) CountBy ¶
CountBy gives the number elements of Int64List that return true for the predicate p.
func (*Int64List) DistinctBy ¶
DistinctBy returns a new Int64List whose elements are unique, where equality is defined by the equal function.
func (*Int64List) DoDeleteAt ¶
DoDeleteAt modifies a Int64List by deleting n elements from a given index.
The list is modified and the modified list is returned. Panics if the index is out of range or n is large enough to take the index out of range.
func (*Int64List) DoDeleteFirst ¶
DoDeleteFirst modifies a Int64List by deleting n elements from the start of the list.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if n is large enough to take the index out of range.
func (*Int64List) DoDeleteLast ¶
DoDeleteLast modifies a Int64List by deleting n elements from the end of the list.
The list is modified and the modified list is returned. Panics if n is large enough to take the index out of range.
func (*Int64List) DoInsertAt ¶
DoInsertAt modifies a Int64List by inserting elements at a given index. This is a generalised version of Append.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if the index is out of range.
func (*Int64List) DoKeepWhere ¶
DoKeepWhere modifies a Int64List by retaining only those elements that match the predicate p. This is very similar to Filter but alters the list in place.
The list is modified and the modified list is returned.
func (*Int64List) DoReverse ¶
DoReverse alters a Int64List with all elements in the reverse order. Unlike Reverse, it does not allocate new memory.
The list is modified and the modified list is returned.
func (*Int64List) DoShuffle ¶
DoShuffle returns a shuffled Int64List, using a version of the Fisher-Yates shuffle.
The list is modified and the modified list is returned.
func (*Int64List) Drop ¶
Drop returns a slice of Int64List without the leading n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*Int64List) DropLast ¶
DropLast returns a slice of Int64List without the trailing n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*Int64List) DropWhile ¶
DropWhile returns a new Int64List containing the trailing elements of the source list. Whilst the predicate p returns true, elements are excluded from the result. Once predicate p returns false, all remaining elements are added.
The original list is not modified.
func (*Int64List) Equals ¶
Equals determines if two lists are equal to each other. If they both are the same size and have the same items in the same order, they are considered equal. Order of items is not relevent for sets to be equal. Nil lists are considered to be empty.
func (*Int64List) Exists ¶
Exists verifies that one or more elements of Int64List return true for the predicate p.
func (*Int64List) Filter ¶
Filter returns a new Int64List whose elements return true for predicate p.
The original list is not modified. See also DoKeepWhere (which does modify the original list).
func (*Int64List) Find ¶
Find returns the first int64 that returns true for predicate p. False is returned if none match.
func (*Int64List) FlatMap ¶
FlatMap returns a new Int64List by transforming every element with function f that returns zero or more items in a slice. The resulting list may have a different size to the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64List) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64List) Fold ¶ added in v0.9.0
Fold aggregates all the values in the list using a supplied function, starting from some initial value.
func (*Int64List) Forall ¶
Forall verifies that all elements of Int64List return true for the predicate p.
func (*Int64List) Foreach ¶
Foreach iterates over Int64List and executes function f against each element. The function can safely alter the values via side-effects.
func (*Int64List) Get ¶
Get gets the specified element in the list. Panics if the index is out of range or the list is nil.
func (*Int64List) GobDecode ¶
GobDecode implements 'gob' decoding for this list type. You must register int64 with the 'gob' package before this method is used.
func (Int64List) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register int64 with the 'gob' package before this method is used.
func (*Int64List) Head ¶
Head gets the first element in the list. Head plus Tail include the whole list. Head is the opposite of Last. Panics if list is empty or nil.
func (*Int64List) HeadOption ¶
HeadOption gets the first element in the list, if possible. Otherwise returns the zero value.
func (*Int64List) IndexWhere ¶
IndexWhere finds the index of the first element satisfying predicate p. If none exists, -1 is returned.
func (*Int64List) IndexWhere2 ¶
IndexWhere2 finds the index of the first element satisfying predicate p at or after some start index. If none exists, -1 is returned.
func (*Int64List) Init ¶
Init gets everything except the last. Init plus Last include the whole list. Init is the opposite of Tail. Panics if list is empty or nil.
func (*Int64List) IsSequence ¶
IsSequence returns true for lists and queues.
func (*Int64List) Last ¶
Last gets the last element in the list. Init plus Last include the whole list. Last is the opposite of Head. Panics if list is empty or nil.
func (*Int64List) LastIndexWhere ¶
LastIndexWhere finds the index of the last element satisfying predicate p. If none exists, -1 is returned.
func (*Int64List) LastIndexWhere2 ¶
LastIndexWhere2 finds the index of the last element satisfying predicate p at or before some start index. If none exists, -1 is returned.
func (*Int64List) LastOption ¶
LastOption gets the last element in the list, if possible. Otherwise returns the zero value.
func (*Int64List) Len ¶
Len returns the number of items in the list - an alias of Size(). This is one of the three methods in the standard sort.Interface.
func (*Int64List) Map ¶
Map returns a new Int64List by transforming every element with function f. The resulting list is the same size as the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64List) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (Int64List) MarshalJSON ¶
MarshalJSON implements JSON encoding for this list type.
func (*Int64List) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*Int64List) MaxBy ¶
MaxBy returns an element of Int64List containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*Int64List) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*Int64List) MinBy ¶
MinBy returns an element of Int64List containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*Int64List) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*Int64List) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*Int64List) Partition ¶
Partition returns two new Int64Lists whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original list is not modified
func (*Int64List) Reverse ¶
Reverse returns a copy of Int64List with all elements in the reverse order.
The original list is not modified.
func (*Int64List) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*Int64List) Shuffle ¶
Shuffle returns a shuffled copy of Int64List, using a version of the Fisher-Yates shuffle.
The original list is not modified.
func (*Int64List) SortBy ¶
SortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned.
func (*Int64List) Sorted ¶
Sorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*Int64List) StableSortBy ¶
StableSortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned. The algorithm keeps the original order of equal elements.
func (*Int64List) StableSorted ¶
StableSorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*Int64List) String ¶
String implements the Stringer interface to render the list as a comma-separated string enclosed in square brackets.
func (*Int64List) StringList ¶
StringList gets a list of strings that depicts all the elements.
func (*Int64List) Swap ¶
Swap exchanges two elements, which is necessary during sorting etc. This is one of the three methods in the standard sort.Interface.
func (*Int64List) Tail ¶
Tail gets everything except the head. Head plus Tail include the whole list. Tail is the opposite of Init. Panics if list is empty or nil.
func (*Int64List) Take ¶
Take returns a slice of Int64List containing the leading n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
func (*Int64List) TakeLast ¶
TakeLast returns a slice of Int64List containing the trailing n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
The original list is not modified.
func (*Int64List) TakeWhile ¶
TakeWhile returns a new Int64List containing the leading elements of the source list. Whilst the predicate p returns true, elements are added to the result. Once predicate p returns false, all remaining elements are excluded.
The original list is not modified.
func (*Int64List) ToInterfaceSlice ¶
func (list *Int64List) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current list as a slice of arbitrary type.
func (*Int64List) ToList ¶
ToList returns the elements of the list as a list, which is an identity operation in this case.
func (*Int64List) ToSet ¶
ToSet returns the elements of the list as a set. The returned set is a shallow copy; the list is not altered.
func (*Int64List) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this list type.
type Int64MkStringer ¶
type Int64MkStringer interface { // String implements the Stringer interface to render the collection as a comma-separated string enclosed // in square brackets. String() string // MkString concatenates the values as a string using a supplied separator. No enclosing marks are added. MkString(sep string) string // MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied. MkString3(before, between, after string) string // implements json.Marshaler interface { MarshalJSON() ([]byte, error) // implements json.Unmarshaler interface { UnmarshalJSON(b []byte) error // StringList gets a collection of strings that depicts all the elements. StringList() []string }
Int64MkStringer defines an interface for stringer methods on int64 collections.
type Int64Queue ¶ added in v0.8.0
type Int64Queue struct {
// contains filtered or unexported fields
}
Int64Queue is a ring buffer containing a slice of type int64. It is optimised for FIFO operations.
func BuildInt64QueueFromChan ¶ added in v0.8.0
func BuildInt64QueueFromChan(source <-chan int64) *Int64Queue
BuildInt64QueueFromChan constructs a new Int64Queue from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func NewInt64Queue ¶ added in v0.8.0
func NewInt64Queue(capacity int, overwrite bool) *Int64Queue
NewInt64Queue returns a new queue of int64. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue.
func NewInt64SortedQueue ¶ added in v0.8.0
func NewInt64SortedQueue(capacity int, overwrite bool, less func(i, j int64) bool) *Int64Queue
NewInt64SortedQueue returns a new queue of int64. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue. If the 'less' comparison function is not nil, elements can be easily sorted.
func (*Int64Queue) Add ¶ added in v0.8.0
func (queue *Int64Queue) Add(more ...int64)
Add adds items to the queue. This is a synonym for Push.
func (*Int64Queue) Cap ¶ added in v0.8.0
func (queue *Int64Queue) Cap() int
Cap gets the capacity of this queue.
func (*Int64Queue) Clone ¶ added in v0.8.0
func (queue *Int64Queue) Clone() *Int64Queue
Clone returns a shallow copy of the queue. It does not clone the underlying elements.
func (*Int64Queue) Contains ¶ added in v0.8.0
func (queue *Int64Queue) Contains(v int64) bool
Contains determines whether a given item is already in the queue, returning true if so.
func (*Int64Queue) ContainsAll ¶ added in v0.8.0
func (queue *Int64Queue) ContainsAll(i ...int64) bool
ContainsAll determines whether the given items are all in the queue, returning true if so. This is potentially a slow method and should only be used rarely.
func (*Int64Queue) CountBy ¶ added in v0.8.0
func (queue *Int64Queue) CountBy(p func(int64) bool) (result int)
CountBy gives the number elements of Int64Queue that return true for the predicate p.
func (*Int64Queue) DoKeepWhere ¶ added in v0.8.0
func (queue *Int64Queue) DoKeepWhere(p func(int64) bool) *Int64Queue
DoKeepWhere modifies a Int64Queue by retaining only those elements that match the predicate p. This is very similar to Filter but alters the queue in place.
The queue is modified and the modified queue is returned.
func (*Int64Queue) Equals ¶ added in v0.8.0
func (queue *Int64Queue) Equals(other *Int64Queue) bool
Equals determines if two queues are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal. Nil queues are considered to be empty.
func (*Int64Queue) Exists ¶ added in v0.8.0
func (queue *Int64Queue) Exists(p func(int64) bool) bool
Exists verifies that one or more elements of Int64Queue return true for the predicate p. The function should not alter the values via side-effects.
func (*Int64Queue) Filter ¶ added in v0.8.0
func (queue *Int64Queue) Filter(p func(int64) bool) *Int64Queue
Filter returns a new Int64Queue whose elements return true for predicate p.
The original queue is not modified. See also DoKeepWhere (which does modify the original queue).
func (*Int64Queue) Find ¶ added in v0.8.0
func (queue *Int64Queue) Find(p func(int64) bool) (int64, bool)
Find returns the first int64 that returns true for predicate p. False is returned if none match.
func (*Int64Queue) FlatMap ¶ added in v0.8.0
func (queue *Int64Queue) FlatMap(f func(int64) []int64) *Int64Queue
FlatMap returns a new Int64Queue by transforming every element with function f that returns zero or more items in a slice. The resulting queue may have a different size to the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Queue) FlatMapToString ¶ added in v0.8.0
func (queue *Int64Queue) FlatMapToString(f func(int64) []string) []string
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Queue) Fold ¶ added in v0.9.0
Fold aggregates all the values in the queue using a supplied function, starting from some initial value.
func (*Int64Queue) Forall ¶ added in v0.8.0
func (queue *Int64Queue) Forall(p func(int64) bool) bool
Forall verifies that all elements of Int64Queue return true for the predicate p. The function should not alter the values via side-effects.
func (*Int64Queue) Foreach ¶ added in v0.8.0
func (queue *Int64Queue) Foreach(f func(int64))
Foreach iterates over Int64Queue and executes function f against each element. The function can safely alter the values via side-effects.
func (*Int64Queue) Get ¶ added in v0.8.0
func (queue *Int64Queue) Get(i int) int64
Get gets the specified element in the queue. Panics if the index is out of range or the queue is nil.
func (*Int64Queue) Head ¶ added in v0.8.0
func (queue *Int64Queue) Head() int64
Head gets the first element in the queue. Head is the opposite of Last. Panics if queue is empty or nil.
func (*Int64Queue) HeadOption ¶ added in v0.8.0
func (queue *Int64Queue) HeadOption() (int64, bool)
HeadOption returns the oldest item in the queue without removing it. If the queue is nil or empty, it returns the zero value instead.
func (*Int64Queue) IsEmpty ¶ added in v0.8.0
func (queue *Int64Queue) IsEmpty() bool
IsEmpty returns true if the queue is empty.
func (*Int64Queue) IsFull ¶ added in v0.8.0
func (queue *Int64Queue) IsFull() bool
IsFull returns true if the queue is full.
func (*Int64Queue) IsOverwriting ¶ added in v0.8.0
func (queue *Int64Queue) IsOverwriting() bool
IsOverwriting returns true if the queue is overwriting, false if refusing.
func (*Int64Queue) IsSequence ¶ added in v0.8.0
func (queue *Int64Queue) IsSequence() bool
IsSequence returns true for ordered lists and queues.
func (*Int64Queue) IsSet ¶ added in v0.8.0
func (queue *Int64Queue) IsSet() bool
IsSet returns false for lists or queues.
func (*Int64Queue) Last ¶ added in v0.8.0
func (queue *Int64Queue) Last() int64
Last gets the the newest item in the queue (i.e. last element pushed) without removing it. Last is the opposite of Head. Panics if queue is empty or nil.
func (*Int64Queue) LastOption ¶ added in v0.8.0
func (queue *Int64Queue) LastOption() (int64, bool)
LastOption returns the newest item in the queue without removing it. If the queue is nil empty, it returns the zero value instead.
func (*Int64Queue) Len ¶ added in v0.8.0
func (queue *Int64Queue) Len() int
Len gets the current length of this queue. This is an alias for Size.
func (*Int64Queue) Less ¶ added in v0.8.0
func (queue *Int64Queue) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j. The queue must have been created with a non-nil 'less' comparison function and it must not be empty.
func (*Int64Queue) Map ¶ added in v0.8.0
func (queue *Int64Queue) Map(f func(int64) int64) *Int64Queue
Map returns a new Int64Queue by transforming every element with function f. The resulting queue is the same size as the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Queue) MapToString ¶ added in v0.8.0
func (queue *Int64Queue) MapToString(f func(int64) string) []string
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (Int64Queue) MarshalJSON ¶ added in v0.8.0
func (queue Int64Queue) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this queue type.
func (*Int64Queue) Max ¶ added in v0.8.0
func (queue *Int64Queue) Max() (result int64)
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*Int64Queue) MaxBy ¶ added in v0.8.0
func (queue *Int64Queue) MaxBy(less func(int64, int64) bool) int64
MaxBy returns an element of Int64Queue containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*Int64Queue) Min ¶ added in v0.8.0
func (queue *Int64Queue) Min() int64
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*Int64Queue) MinBy ¶ added in v0.8.0
func (queue *Int64Queue) MinBy(less func(int64, int64) bool) int64
MinBy returns an element of Int64Queue containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*Int64Queue) MkString ¶ added in v0.8.0
func (queue *Int64Queue) MkString(sep string) string
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*Int64Queue) MkString3 ¶ added in v0.8.0
func (queue *Int64Queue) MkString3(before, between, after string) string
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*Int64Queue) NonEmpty ¶ added in v0.8.0
func (queue *Int64Queue) NonEmpty() bool
NonEmpty returns true if the queue is not empty.
func (*Int64Queue) Offer ¶ added in v0.8.0
func (queue *Int64Queue) Offer(items ...int64) []int64
Offer appends as many items to the end of the queue as it can. If the queue is already full, what happens depends on whether the queue is configured to overwrite. If it is, the oldest items will be overwritten. Otherwise, it will be filled to capacity and any unwritten items are returned.
If the capacity is too small for the number of items, the excess items are returned. The queue capacity is never altered.
func (*Int64Queue) Partition ¶ added in v0.8.0
func (queue *Int64Queue) Partition(p func(int64) bool) (*Int64Queue, *Int64Queue)
Partition returns two new Int64Queues whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original queue.
The original queue is not modified
func (*Int64Queue) Pop ¶ added in v0.8.0
func (queue *Int64Queue) Pop(n int) []int64
Pop removes and returns the oldest items from the queue. If the queue is empty, it returns a nil slice. If n is larger than the current queue length, it returns all the available elements, so in this case the returned slice will be shorter than n.
func (*Int64Queue) Pop1 ¶ added in v0.8.0
func (queue *Int64Queue) Pop1() (int64, bool)
Pop1 removes and returns the oldest item from the queue. If the queue is empty, it returns the zero value instead. The boolean is true only if the element was available.
func (*Int64Queue) Push ¶ added in v0.8.0
func (queue *Int64Queue) Push(items ...int64) *Int64Queue
Push appends items to the end of the queue. If the queue does not have enough space, more will be allocated: how this happens depends on the overwriting mode.
When overwriting, the oldest items are overwritten with the new data; it expands the queue only if there is still not enough space.
Otherwise, the queue might be reallocated if necessary, ensuring that all the data is pushed without any older items being affected.
The modified queue is returned.
func (*Int64Queue) Reallocate ¶ added in v0.8.0
func (queue *Int64Queue) Reallocate(capacity int, overwrite bool) *Int64Queue
Reallocate adjusts the allocated capacity of the queue and allows the overwriting behaviour to be changed.
If the new queue capacity is different to the current capacity, the queue is re-allocated to the new capacity. If this is less than the current number of elements, the oldest items in the queue are discarded so that the remaining data can fit in the new space available.
If the new queue capacity is the same as the current capacity, the queue is not altered except for adopting the new overwrite flag's value. Therefore this is the means to change the overwriting behaviour.
Reallocate adjusts the storage space but does not clone the underlying elements.
The queue must not be nil.
func (*Int64Queue) Send ¶ added in v0.8.0
func (queue *Int64Queue) Send() <-chan int64
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*Int64Queue) Size ¶ added in v0.8.0
func (queue *Int64Queue) Size() int
Size gets the number of elements currently in this queue. This is an alias for Len.
func (*Int64Queue) Sort ¶ added in v0.8.0
func (queue *Int64Queue) Sort()
Sort sorts the queue using the 'less' comparison function, which must not be nil. This function will panic if the collection was created with a nil 'less' function (see NewInt64SortedQueue).
func (*Int64Queue) Space ¶ added in v0.8.0
func (queue *Int64Queue) Space() int
Space returns the space available in the queue.
func (*Int64Queue) StableSort ¶ added in v0.8.0
func (queue *Int64Queue) StableSort()
StableSort sorts the queue using the 'less' comparison function, which must not be nil. The result is stable so that repeated calls will not arbitrarily swap equal items. This function will panic if the collection was created with a nil 'less' function (see NewInt64SortedQueue).
func (*Int64Queue) String ¶ added in v0.8.0
func (queue *Int64Queue) String() string
String implements the Stringer interface to render the queue as a comma-separated string enclosed in square brackets.
func (*Int64Queue) StringList ¶ added in v0.8.0
func (queue *Int64Queue) StringList() []string
StringList gets a list of strings that depicts all the elements.
func (*Int64Queue) Sum ¶ added in v0.8.0
func (queue *Int64Queue) Sum() int64
Sum returns the sum of all the elements in the queue.
func (*Int64Queue) Swap ¶ added in v0.8.0
func (queue *Int64Queue) Swap(i, j int)
Swap swaps the elements with indexes i and j. The queue must not be empty.
func (*Int64Queue) ToInterfaceSlice ¶ added in v0.8.0
func (queue *Int64Queue) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the queue as a slice of arbitrary type. The queue is not altered.
func (*Int64Queue) ToList ¶ added in v0.9.0
func (queue *Int64Queue) ToList() *Int64List
ToList returns the elements of the queue as a list. The returned list is a shallow copy; the queue is not altered.
func (*Int64Queue) ToSet ¶ added in v0.8.0
func (queue *Int64Queue) ToSet() *Int64Set
ToSet returns the elements of the queue as a set. The returned set is a shallow copy; the queue is not altered.
func (*Int64Queue) ToSlice ¶ added in v0.8.0
func (queue *Int64Queue) ToSlice() []int64
ToSlice returns the elements of the queue as a slice. The queue is not altered.
func (*Int64Queue) UnmarshalJSON ¶ added in v0.8.0
func (queue *Int64Queue) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this queue type.
type Int64Sequence ¶ added in v0.9.0
type Int64Sequence interface { Int64Collection // Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last. Head() int64 // HeadOption gets the first element in the sequence, if possible. HeadOption() (int64, bool) // Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head. Last() int64 // LastOption gets the last element in the sequence, if possible. LastOption() (int64, bool) }
Int64Sequence defines an interface for sequence methods on int64.
type Int64Set ¶
type Int64Set struct {
// contains filtered or unexported fields
}
Int64Set is the primary type that represents a set.
func BuildInt64SetFromChan ¶
BuildInt64SetFromChan constructs a new Int64Set from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertInt64Set ¶
ConvertInt64Set constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned set will contain all the values that were correctly converted.
func NewInt64Set ¶
NewInt64Set creates and returns a reference to an empty set.
func (*Int64Set) Cardinality ¶
Cardinality returns how many items are currently in the set. This is a synonym for Size.
func (*Int64Set) Clear ¶
func (set *Int64Set) Clear()
Clear the entire set. Aterwards, it will be an empty set.
func (*Int64Set) Clone ¶
Clone returns a shallow copy of the set. It does not clone the underlying elements.
func (*Int64Set) Contains ¶
Contains determines whether a given item is already in the set, returning true if so.
func (*Int64Set) ContainsAll ¶
ContainsAll determines whether the given items are all in the set, returning true if so.
func (*Int64Set) CountBy ¶
CountBy gives the number elements of Int64Set that return true for the predicate p.
func (*Int64Set) Difference ¶
Difference returns a new set with items in the current set but not in the other set
func (*Int64Set) Equals ¶
Equals determines whether two sets are equal to each other, returning true if so. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (*Int64Set) Exists ¶
Exists applies a predicate p to every element in the set. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*Int64Set) Filter ¶
Filter returns a new Int64Set whose elements return true for the predicate p.
The original set is not modified
func (*Int64Set) Find ¶
Find returns the first int64 that returns true for the predicate p. If there are many matches one is arbtrarily chosen. False is returned if none match.
func (*Int64Set) FlatMap ¶
FlatMap returns a new Int64Set by transforming every element with a function f that returns zero or more items in a slice. The resulting set may have a different size to the original set. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Set) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Set) Fold ¶ added in v0.9.0
Fold aggregates all the values in the set using a supplied function, starting from some initial value.
func (*Int64Set) Forall ¶
Forall applies a predicate function p to every element in the set. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*Int64Set) Foreach ¶
Foreach iterates over the set and executes the function f against each element. The function can safely alter the values via side-effects.
func (*Int64Set) GobDecode ¶
GobDecode implements 'gob' decoding for this set type. You must register int64 with the 'gob' package before this method is used.
func (Int64Set) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register int64 with the 'gob' package before this method is used.
func (*Int64Set) IsSequence ¶
IsSequence returns true for lists and queues.
func (*Int64Set) IsSubset ¶
IsSubset determines whether every item in the other set is in this set, returning true if so.
func (*Int64Set) IsSuperset ¶
IsSuperset determines whether every item of this set is in the other set, returning true if so.
func (*Int64Set) Map ¶
Map returns a new Int64Set by transforming every element with a function f. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Set) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64Set) MarshalJSON ¶
MarshalJSON implements JSON encoding for this set type.
func (*Int64Set) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*Int64Set) MaxBy ¶
MaxBy returns an element of Int64Set containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*Int64Set) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*Int64Set) MinBy ¶
MinBy returns an element of Int64Set containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*Int64Set) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*Int64Set) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*Int64Set) Partition ¶
Partition returns two new Int64Sets whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original set is not modified
func (*Int64Set) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed
func (*Int64Set) Size ¶
Size returns how many items are currently in the set. This is a synonym for Cardinality.
func (*Int64Set) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*Int64Set) StringList ¶
StringSet gets a list of strings that depicts all the elements.
func (*Int64Set) StringMap ¶
StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.
func (*Int64Set) SymmetricDifference ¶
SymmetricDifference returns a new set with items in the current set or the other set but not in both.
func (*Int64Set) ToInterfaceSlice ¶
func (set *Int64Set) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.
func (*Int64Set) ToList ¶
ToList returns the elements of the set as a list. The returned list is a shallow copy; the set is not altered.
func (*Int64Set) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this set type.
type Int64Sizer ¶
type Int64Sizer interface { // IsEmpty tests whether Int64Collection is empty. IsEmpty() bool // NonEmpty tests whether Int64Collection is empty. NonEmpty() bool // Size returns the number of items in the collection - an alias of Len(). Size() int }
Int64Sizer defines an interface for sizing methods on int64 collections.
type Int64StringMap ¶
type Int64StringMap struct {
// contains filtered or unexported fields
}
Int64StringMap is the primary type that represents a thread-safe map
func NewInt64StringMap ¶
func NewInt64StringMap(kv ...Int64StringTuple) *Int64StringMap
NewInt64StringMap creates and returns a reference to a map, optionally containing some items.
func NewInt64StringMap1 ¶
func NewInt64StringMap1(k int64, v string) *Int64StringMap
NewInt64StringMap1 creates and returns a reference to a map containing one item.
func (*Int64StringMap) Clone ¶
func (mm *Int64StringMap) Clone() *Int64StringMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*Int64StringMap) ContainsAllKeys ¶
func (mm *Int64StringMap) ContainsAllKeys(kk ...int64) bool
ContainsAllKeys determines if the given items are all in the map.
func (*Int64StringMap) ContainsKey ¶
func (mm *Int64StringMap) ContainsKey(k int64) bool
ContainsKey determines if a given item is already in the map.
func (*Int64StringMap) DropWhere ¶
func (mm *Int64StringMap) DropWhere(fn func(int64, string) bool) Int64StringTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*Int64StringMap) Equals ¶
func (mm *Int64StringMap) Equals(other *Int64StringMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*Int64StringMap) Exists ¶
func (mm *Int64StringMap) Exists(p func(int64, string) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*Int64StringMap) Filter ¶
func (mm *Int64StringMap) Filter(p func(int64, string) bool) *Int64StringMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*Int64StringMap) Find ¶
func (mm *Int64StringMap) Find(p func(int64, string) bool) (Int64StringTuple, bool)
Find returns the first string that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*Int64StringMap) FlatMap ¶
func (mm *Int64StringMap) FlatMap(f func(int64, string) []Int64StringTuple) *Int64StringMap
FlatMap returns a new StringMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64StringMap) Forall ¶
func (mm *Int64StringMap) Forall(p func(int64, string) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*Int64StringMap) Foreach ¶
func (mm *Int64StringMap) Foreach(f func(int64, string))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*Int64StringMap) Get ¶
func (mm *Int64StringMap) Get(k int64) (string, bool)
Get returns one of the items in the map, if present.
func (*Int64StringMap) GobDecode ¶
func (mm *Int64StringMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register string with the 'gob' package before this method is used.
func (*Int64StringMap) GobEncode ¶
func (mm *Int64StringMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register string with the 'gob' package before this method is used.
func (*Int64StringMap) IsEmpty ¶
func (mm *Int64StringMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*Int64StringMap) Keys ¶
func (mm *Int64StringMap) Keys() collection.Int64List
Keys returns the keys of the current map as a slice.
func (*Int64StringMap) Map ¶
func (mm *Int64StringMap) Map(f func(int64, string) (int64, string)) *Int64StringMap
Map returns a new StringMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Int64StringMap) MkString ¶
func (mm *Int64StringMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*Int64StringMap) MkString4 ¶ added in v0.7.0
func (mm *Int64StringMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*Int64StringMap) NonEmpty ¶
func (mm *Int64StringMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*Int64StringMap) OrderedSlice ¶
func (mm *Int64StringMap) OrderedSlice(keys collection.Int64List) Int64StringTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*Int64StringMap) Partition ¶
func (mm *Int64StringMap) Partition(p func(int64, string) bool) (matching *Int64StringMap, others *Int64StringMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*Int64StringMap) Pop ¶
func (mm *Int64StringMap) Pop(k int64) (string, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*Int64StringMap) Put ¶
func (mm *Int64StringMap) Put(k int64, v string) bool
Put adds an item to the current map, replacing any prior value.
func (*Int64StringMap) Remove ¶
func (mm *Int64StringMap) Remove(k int64)
Remove a single item from the map.
func (*Int64StringMap) Size ¶
func (mm *Int64StringMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*Int64StringMap) String ¶
func (mm *Int64StringMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*Int64StringMap) ToSlice ¶
func (mm *Int64StringMap) ToSlice() Int64StringTuples
ToSlice returns the key/value pairs as a slice
func (*Int64StringMap) Values ¶
func (mm *Int64StringMap) Values() collection.StringList
Values returns the values of the current map as a slice.
type Int64StringTuple ¶
Int64StringTuple represents a key/value pair.
func (Int64StringTuple) MarshalJSON ¶
func (t Int64StringTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (Int64StringTuple) UnmarshalJSON ¶
func (t Int64StringTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type Int64StringTuples ¶
type Int64StringTuples []Int64StringTuple
Int64StringTuples can be used as a builder for unmodifiable maps.
func Int64StringZip ¶
func Int64StringZip(keys ...int64) Int64StringTuples
Int64StringZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewInt64StringMap constructor function.
func (Int64StringTuples) Append1 ¶
func (ts Int64StringTuples) Append1(k int64, v string) Int64StringTuples
Append1 adds one item.
func (Int64StringTuples) Append2 ¶
func (ts Int64StringTuples) Append2(k1 int64, v1 string, k2 int64, v2 string) Int64StringTuples
Append2 adds two items.
func (Int64StringTuples) Append3 ¶
func (ts Int64StringTuples) Append3(k1 int64, v1 string, k2 int64, v2 string, k3 int64, v3 string) Int64StringTuples
Append3 adds three items.
func (Int64StringTuples) MkString ¶
func (ts Int64StringTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (Int64StringTuples) MkString4 ¶ added in v0.7.0
func (ts Int64StringTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (Int64StringTuples) String ¶
func (ts Int64StringTuples) String() string
func (Int64StringTuples) ToMap ¶
func (ts Int64StringTuples) ToMap() *Int64StringMap
ToMap converts the tuples to a map.
func (Int64StringTuples) Values ¶
func (ts Int64StringTuples) Values(values ...string) Int64StringTuples
Values sets the values in a tuple slice. Use this with Int64StringZip.
type IntCollection ¶
type IntCollection interface { IntSizer IntMkStringer // IsSequence returns true for lists and queues. IsSequence() bool // IsSet returns false for lists and queues. IsSet() bool // ToSlice returns a shallow copy as a plain slice. ToSlice() []int // ToInterfaceSlice returns a shallow copy as a slice of arbitrary type. ToInterfaceSlice() []interface{} // Exists verifies that one or more elements of IntCollection return true for the predicate p. Exists(p func(int) bool) bool // Forall verifies that all elements of IntCollection return true for the predicate p. Forall(p func(int) bool) bool // Foreach iterates over IntCollection and executes the function f against each element. Foreach(f func(int)) // Find returns the first int that returns true for the predicate p. // False is returned if none match. Find(p func(int) bool) (int, bool) // MapToString returns a new []string by transforming every element with function f. // The resulting slice is the same size as the collection. The collection is not modified. MapToString(f func(int) string) []string // FlatMapString returns a new []string by transforming every element with function f // that returns zero or more items in a slice. The resulting slice may have a different size to the // collection. The collection is not modified. FlatMapToString(f func(int) []string) []string // Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example. // A goroutine is created to send the elements; this only terminates when all the elements have been consumed Send() <-chan int // CountBy gives the number elements of IntCollection that return true for the predicate p. CountBy(p func(int) bool) int // Contains determines whether a given item is already in the collection, returning true if so. Contains(v int) bool // ContainsAll determines whether the given items are all in the collection, returning true if so. ContainsAll(v ...int) bool // Clear the entire collection. Clear() // Add adds items to the current collection. Add(more ...int) // Min returns the minimum value of all the items in the collection. Panics if there are no elements. Min() int // Max returns the minimum value of all the items in the collection. Panics if there are no elements. Max() int // MinBy returns an element of IntCollection containing the minimum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such // element is returned. Panics if there are no elements. MinBy(less func(int, int) bool) int // MaxBy returns an element of IntCollection containing the maximum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such // element is returned. Panics if there are no elements. MaxBy(less func(int, int) bool) int // Fold aggregates all the values in the collection using a supplied function, starting from some initial value. Fold(initial int, fn func(int, int) int) int // Sum returns the sum of all the elements in the collection. Sum() int }
IntCollection defines an interface for common collection methods on int.
type IntIntMap ¶
type IntIntMap struct {
// contains filtered or unexported fields
}
IntIntMap is the primary type that represents a thread-safe map
func NewIntIntMap ¶
func NewIntIntMap(kv ...IntIntTuple) *IntIntMap
NewIntIntMap creates and returns a reference to a map, optionally containing some items.
func NewIntIntMap1 ¶
NewIntIntMap1 creates and returns a reference to a map containing one item.
func (*IntIntMap) Clone ¶
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*IntIntMap) ContainsAllKeys ¶
ContainsAllKeys determines if the given items are all in the map.
func (*IntIntMap) ContainsKey ¶
ContainsKey determines if a given item is already in the map.
func (*IntIntMap) DropWhere ¶
func (mm *IntIntMap) DropWhere(fn func(int, int) bool) IntIntTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*IntIntMap) Equals ¶
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*IntIntMap) Exists ¶
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*IntIntMap) Filter ¶
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*IntIntMap) Find ¶
Find returns the first int that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*IntIntMap) FlatMap ¶
func (mm *IntIntMap) FlatMap(f func(int, int) []IntIntTuple) *IntIntMap
FlatMap returns a new IntMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntIntMap) Forall ¶
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*IntIntMap) Foreach ¶
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*IntIntMap) GobDecode ¶
GobDecode implements 'gob' decoding for this map type. You must register int with the 'gob' package before this method is used.
func (*IntIntMap) GobEncode ¶
GobEncode implements 'gob' encoding for this map type. You must register int with the 'gob' package before this method is used.
func (*IntIntMap) Keys ¶
func (mm *IntIntMap) Keys() collection.IntList
Keys returns the keys of the current map as a slice.
func (*IntIntMap) Map ¶
Map returns a new IntMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntIntMap) MkString ¶
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*IntIntMap) MkString4 ¶ added in v0.7.0
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*IntIntMap) OrderedSlice ¶
func (mm *IntIntMap) OrderedSlice(keys collection.IntList) IntIntTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*IntIntMap) Partition ¶
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*IntIntMap) Pop ¶
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*IntIntMap) Size ¶
Size returns how many items are currently in the map. This is a synonym for Len.
func (*IntIntMap) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*IntIntMap) ToSlice ¶
func (mm *IntIntMap) ToSlice() IntIntTuples
ToSlice returns the key/value pairs as a slice
func (*IntIntMap) Values ¶
func (mm *IntIntMap) Values() collection.IntList
Values returns the values of the current map as a slice.
type IntIntTuple ¶
IntIntTuple represents a key/value pair.
func (IntIntTuple) MarshalJSON ¶
func (t IntIntTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (IntIntTuple) UnmarshalJSON ¶
func (t IntIntTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type IntIntTuples ¶
type IntIntTuples []IntIntTuple
IntIntTuples can be used as a builder for unmodifiable maps.
func IntIntZip ¶
func IntIntZip(keys ...int) IntIntTuples
IntIntZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewIntIntMap constructor function.
func (IntIntTuples) Append1 ¶
func (ts IntIntTuples) Append1(k int, v int) IntIntTuples
Append1 adds one item.
func (IntIntTuples) Append2 ¶
func (ts IntIntTuples) Append2(k1 int, v1 int, k2 int, v2 int) IntIntTuples
Append2 adds two items.
func (IntIntTuples) Append3 ¶
func (ts IntIntTuples) Append3(k1 int, v1 int, k2 int, v2 int, k3 int, v3 int) IntIntTuples
Append3 adds three items.
func (IntIntTuples) MkString ¶
func (ts IntIntTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (IntIntTuples) MkString4 ¶ added in v0.7.0
func (ts IntIntTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (IntIntTuples) String ¶
func (ts IntIntTuples) String() string
func (IntIntTuples) ToMap ¶
func (ts IntIntTuples) ToMap() *IntIntMap
ToMap converts the tuples to a map.
func (IntIntTuples) Values ¶
func (ts IntIntTuples) Values(values ...int) IntIntTuples
Values sets the values in a tuple slice. Use this with IntIntZip.
type IntList ¶
type IntList struct {
// contains filtered or unexported fields
}
IntList contains a slice of type int. It encapsulates the slice and provides methods to access or mutate it.
List values follow a similar pattern to Scala Lists and LinearSeqs in particular. For comparison with Scala, see e.g. http://www.scala-lang.org/api/2.11.7/#scala.collection.LinearSeq
func BuildIntListFromChan ¶
BuildIntListFromChan constructs a new IntList from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertIntList ¶
ConvertIntList constructs a new list containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned list will contain all the values that were correctly converted. Conversions are provided from all built-in numeric types.
func MakeIntList ¶
MakeIntList makes an empty list with both length and capacity initialised.
func NewIntList ¶
NewIntList constructs a new list containing the supplied values, if any.
func (*IntList) Append ¶
Append adds items to the current list. If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned.
func (*IntList) Clone ¶
Clone returns a shallow copy of the list. It does not clone the underlying elements.
func (*IntList) Contains ¶
Contains determines whether a given item is already in the list, returning true if so.
func (*IntList) ContainsAll ¶
ContainsAll determines whether the given items are all in the list, returning true if so. This is potentially a slow method and should only be used rarely.
func (*IntList) CountBy ¶
CountBy gives the number elements of IntList that return true for the predicate p.
func (*IntList) DistinctBy ¶
DistinctBy returns a new IntList whose elements are unique, where equality is defined by the equal function.
func (*IntList) DoDeleteAt ¶
DoDeleteAt modifies a IntList by deleting n elements from a given index.
The list is modified and the modified list is returned. Panics if the index is out of range or n is large enough to take the index out of range.
func (*IntList) DoDeleteFirst ¶
DoDeleteFirst modifies a IntList by deleting n elements from the start of the list.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if n is large enough to take the index out of range.
func (*IntList) DoDeleteLast ¶
DoDeleteLast modifies a IntList by deleting n elements from the end of the list.
The list is modified and the modified list is returned. Panics if n is large enough to take the index out of range.
func (*IntList) DoInsertAt ¶
DoInsertAt modifies a IntList by inserting elements at a given index. This is a generalised version of Append.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if the index is out of range.
func (*IntList) DoKeepWhere ¶
DoKeepWhere modifies a IntList by retaining only those elements that match the predicate p. This is very similar to Filter but alters the list in place.
The list is modified and the modified list is returned.
func (*IntList) DoReverse ¶
DoReverse alters a IntList with all elements in the reverse order. Unlike Reverse, it does not allocate new memory.
The list is modified and the modified list is returned.
func (*IntList) DoShuffle ¶
DoShuffle returns a shuffled IntList, using a version of the Fisher-Yates shuffle.
The list is modified and the modified list is returned.
func (*IntList) Drop ¶
Drop returns a slice of IntList without the leading n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*IntList) DropLast ¶
DropLast returns a slice of IntList without the trailing n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*IntList) DropWhile ¶
DropWhile returns a new IntList containing the trailing elements of the source list. Whilst the predicate p returns true, elements are excluded from the result. Once predicate p returns false, all remaining elements are added.
The original list is not modified.
func (*IntList) Equals ¶
Equals determines if two lists are equal to each other. If they both are the same size and have the same items in the same order, they are considered equal. Order of items is not relevent for sets to be equal. Nil lists are considered to be empty.
func (*IntList) Exists ¶
Exists verifies that one or more elements of IntList return true for the predicate p.
func (*IntList) Filter ¶
Filter returns a new IntList whose elements return true for predicate p.
The original list is not modified. See also DoKeepWhere (which does modify the original list).
func (*IntList) Find ¶
Find returns the first int that returns true for predicate p. False is returned if none match.
func (*IntList) FlatMap ¶
FlatMap returns a new IntList by transforming every element with function f that returns zero or more items in a slice. The resulting list may have a different size to the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntList) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntList) Fold ¶ added in v0.9.0
Fold aggregates all the values in the list using a supplied function, starting from some initial value.
func (*IntList) Forall ¶
Forall verifies that all elements of IntList return true for the predicate p.
func (*IntList) Foreach ¶
Foreach iterates over IntList and executes function f against each element. The function can safely alter the values via side-effects.
func (*IntList) Get ¶
Get gets the specified element in the list. Panics if the index is out of range or the list is nil.
func (*IntList) GobDecode ¶
GobDecode implements 'gob' decoding for this list type. You must register int with the 'gob' package before this method is used.
func (IntList) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register int with the 'gob' package before this method is used.
func (*IntList) Head ¶
Head gets the first element in the list. Head plus Tail include the whole list. Head is the opposite of Last. Panics if list is empty or nil.
func (*IntList) HeadOption ¶
HeadOption gets the first element in the list, if possible. Otherwise returns the zero value.
func (*IntList) IndexWhere ¶
IndexWhere finds the index of the first element satisfying predicate p. If none exists, -1 is returned.
func (*IntList) IndexWhere2 ¶
IndexWhere2 finds the index of the first element satisfying predicate p at or after some start index. If none exists, -1 is returned.
func (*IntList) Init ¶
Init gets everything except the last. Init plus Last include the whole list. Init is the opposite of Tail. Panics if list is empty or nil.
func (*IntList) IsSequence ¶
IsSequence returns true for lists and queues.
func (*IntList) Last ¶
Last gets the last element in the list. Init plus Last include the whole list. Last is the opposite of Head. Panics if list is empty or nil.
func (*IntList) LastIndexWhere ¶
LastIndexWhere finds the index of the last element satisfying predicate p. If none exists, -1 is returned.
func (*IntList) LastIndexWhere2 ¶
LastIndexWhere2 finds the index of the last element satisfying predicate p at or before some start index. If none exists, -1 is returned.
func (*IntList) LastOption ¶
LastOption gets the last element in the list, if possible. Otherwise returns the zero value.
func (*IntList) Len ¶
Len returns the number of items in the list - an alias of Size(). This is one of the three methods in the standard sort.Interface.
func (*IntList) Map ¶
Map returns a new IntList by transforming every element with function f. The resulting list is the same size as the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntList) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (IntList) MarshalJSON ¶
MarshalJSON implements JSON encoding for this list type.
func (*IntList) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*IntList) MaxBy ¶
MaxBy returns an element of IntList containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*IntList) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*IntList) MinBy ¶
MinBy returns an element of IntList containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*IntList) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*IntList) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*IntList) Partition ¶
Partition returns two new IntLists whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original list is not modified
func (*IntList) Reverse ¶
Reverse returns a copy of IntList with all elements in the reverse order.
The original list is not modified.
func (*IntList) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*IntList) Shuffle ¶
Shuffle returns a shuffled copy of IntList, using a version of the Fisher-Yates shuffle.
The original list is not modified.
func (*IntList) SortBy ¶
SortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned.
func (*IntList) Sorted ¶
Sorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*IntList) StableSortBy ¶
StableSortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned. The algorithm keeps the original order of equal elements.
func (*IntList) StableSorted ¶
StableSorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*IntList) String ¶
String implements the Stringer interface to render the list as a comma-separated string enclosed in square brackets.
func (*IntList) StringList ¶
StringList gets a list of strings that depicts all the elements.
func (*IntList) Swap ¶
Swap exchanges two elements, which is necessary during sorting etc. This is one of the three methods in the standard sort.Interface.
func (*IntList) Tail ¶
Tail gets everything except the head. Head plus Tail include the whole list. Tail is the opposite of Init. Panics if list is empty or nil.
func (*IntList) Take ¶
Take returns a slice of IntList containing the leading n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
func (*IntList) TakeLast ¶
TakeLast returns a slice of IntList containing the trailing n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
The original list is not modified.
func (*IntList) TakeWhile ¶
TakeWhile returns a new IntList containing the leading elements of the source list. Whilst the predicate p returns true, elements are added to the result. Once predicate p returns false, all remaining elements are excluded.
The original list is not modified.
func (*IntList) ToInterfaceSlice ¶
func (list *IntList) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current list as a slice of arbitrary type.
func (*IntList) ToList ¶
ToList returns the elements of the list as a list, which is an identity operation in this case.
func (*IntList) ToSet ¶
ToSet returns the elements of the list as a set. The returned set is a shallow copy; the list is not altered.
func (*IntList) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this list type.
type IntMkStringer ¶
type IntMkStringer interface { // String implements the Stringer interface to render the collection as a comma-separated string enclosed // in square brackets. String() string // MkString concatenates the values as a string using a supplied separator. No enclosing marks are added. MkString(sep string) string // MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied. MkString3(before, between, after string) string // implements json.Marshaler interface { MarshalJSON() ([]byte, error) // implements json.Unmarshaler interface { UnmarshalJSON(b []byte) error // StringList gets a collection of strings that depicts all the elements. StringList() []string }
IntMkStringer defines an interface for stringer methods on int collections.
type IntQueue ¶ added in v0.8.0
type IntQueue struct {
// contains filtered or unexported fields
}
IntQueue is a ring buffer containing a slice of type int. It is optimised for FIFO operations.
func BuildIntQueueFromChan ¶ added in v0.8.0
BuildIntQueueFromChan constructs a new IntQueue from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func NewIntQueue ¶ added in v0.8.0
NewIntQueue returns a new queue of int. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue.
func NewIntSortedQueue ¶ added in v0.8.0
NewIntSortedQueue returns a new queue of int. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue. If the 'less' comparison function is not nil, elements can be easily sorted.
func (*IntQueue) Clone ¶ added in v0.8.0
Clone returns a shallow copy of the queue. It does not clone the underlying elements.
func (*IntQueue) Contains ¶ added in v0.8.0
Contains determines whether a given item is already in the queue, returning true if so.
func (*IntQueue) ContainsAll ¶ added in v0.8.0
ContainsAll determines whether the given items are all in the queue, returning true if so. This is potentially a slow method and should only be used rarely.
func (*IntQueue) CountBy ¶ added in v0.8.0
CountBy gives the number elements of IntQueue that return true for the predicate p.
func (*IntQueue) DoKeepWhere ¶ added in v0.8.0
DoKeepWhere modifies a IntQueue by retaining only those elements that match the predicate p. This is very similar to Filter but alters the queue in place.
The queue is modified and the modified queue is returned.
func (*IntQueue) Equals ¶ added in v0.8.0
Equals determines if two queues are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal. Nil queues are considered to be empty.
func (*IntQueue) Exists ¶ added in v0.8.0
Exists verifies that one or more elements of IntQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*IntQueue) Filter ¶ added in v0.8.0
Filter returns a new IntQueue whose elements return true for predicate p.
The original queue is not modified. See also DoKeepWhere (which does modify the original queue).
func (*IntQueue) Find ¶ added in v0.8.0
Find returns the first int that returns true for predicate p. False is returned if none match.
func (*IntQueue) FlatMap ¶ added in v0.8.0
FlatMap returns a new IntQueue by transforming every element with function f that returns zero or more items in a slice. The resulting queue may have a different size to the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntQueue) FlatMapToString ¶ added in v0.8.0
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntQueue) Fold ¶ added in v0.9.0
Fold aggregates all the values in the queue using a supplied function, starting from some initial value.
func (*IntQueue) Forall ¶ added in v0.8.0
Forall verifies that all elements of IntQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*IntQueue) Foreach ¶ added in v0.8.0
Foreach iterates over IntQueue and executes function f against each element. The function can safely alter the values via side-effects.
func (*IntQueue) Get ¶ added in v0.8.0
Get gets the specified element in the queue. Panics if the index is out of range or the queue is nil.
func (*IntQueue) Head ¶ added in v0.8.0
Head gets the first element in the queue. Head is the opposite of Last. Panics if queue is empty or nil.
func (*IntQueue) HeadOption ¶ added in v0.8.0
HeadOption returns the oldest item in the queue without removing it. If the queue is nil or empty, it returns the zero value instead.
func (*IntQueue) IsOverwriting ¶ added in v0.8.0
IsOverwriting returns true if the queue is overwriting, false if refusing.
func (*IntQueue) IsSequence ¶ added in v0.8.0
IsSequence returns true for ordered lists and queues.
func (*IntQueue) Last ¶ added in v0.8.0
Last gets the the newest item in the queue (i.e. last element pushed) without removing it. Last is the opposite of Head. Panics if queue is empty or nil.
func (*IntQueue) LastOption ¶ added in v0.8.0
LastOption returns the newest item in the queue without removing it. If the queue is nil empty, it returns the zero value instead.
func (*IntQueue) Len ¶ added in v0.8.0
Len gets the current length of this queue. This is an alias for Size.
func (*IntQueue) Less ¶ added in v0.8.0
Less reports whether the element with index i should sort before the element with index j. The queue must have been created with a non-nil 'less' comparison function and it must not be empty.
func (*IntQueue) Map ¶ added in v0.8.0
Map returns a new IntQueue by transforming every element with function f. The resulting queue is the same size as the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntQueue) MapToString ¶ added in v0.8.0
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (IntQueue) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements JSON encoding for this queue type.
func (*IntQueue) Max ¶ added in v0.8.0
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*IntQueue) MaxBy ¶ added in v0.8.0
MaxBy returns an element of IntQueue containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*IntQueue) Min ¶ added in v0.8.0
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*IntQueue) MinBy ¶ added in v0.8.0
MinBy returns an element of IntQueue containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*IntQueue) MkString ¶ added in v0.8.0
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*IntQueue) MkString3 ¶ added in v0.8.0
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*IntQueue) Offer ¶ added in v0.8.0
Offer appends as many items to the end of the queue as it can. If the queue is already full, what happens depends on whether the queue is configured to overwrite. If it is, the oldest items will be overwritten. Otherwise, it will be filled to capacity and any unwritten items are returned.
If the capacity is too small for the number of items, the excess items are returned. The queue capacity is never altered.
func (*IntQueue) Partition ¶ added in v0.8.0
Partition returns two new IntQueues whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original queue.
The original queue is not modified
func (*IntQueue) Pop ¶ added in v0.8.0
Pop removes and returns the oldest items from the queue. If the queue is empty, it returns a nil slice. If n is larger than the current queue length, it returns all the available elements, so in this case the returned slice will be shorter than n.
func (*IntQueue) Pop1 ¶ added in v0.8.0
Pop1 removes and returns the oldest item from the queue. If the queue is empty, it returns the zero value instead. The boolean is true only if the element was available.
func (*IntQueue) Push ¶ added in v0.8.0
Push appends items to the end of the queue. If the queue does not have enough space, more will be allocated: how this happens depends on the overwriting mode.
When overwriting, the oldest items are overwritten with the new data; it expands the queue only if there is still not enough space.
Otherwise, the queue might be reallocated if necessary, ensuring that all the data is pushed without any older items being affected.
The modified queue is returned.
func (*IntQueue) Reallocate ¶ added in v0.8.0
Reallocate adjusts the allocated capacity of the queue and allows the overwriting behaviour to be changed.
If the new queue capacity is different to the current capacity, the queue is re-allocated to the new capacity. If this is less than the current number of elements, the oldest items in the queue are discarded so that the remaining data can fit in the new space available.
If the new queue capacity is the same as the current capacity, the queue is not altered except for adopting the new overwrite flag's value. Therefore this is the means to change the overwriting behaviour.
Reallocate adjusts the storage space but does not clone the underlying elements.
The queue must not be nil.
func (*IntQueue) Send ¶ added in v0.8.0
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*IntQueue) Size ¶ added in v0.8.0
Size gets the number of elements currently in this queue. This is an alias for Len.
func (*IntQueue) Sort ¶ added in v0.8.0
func (queue *IntQueue) Sort()
Sort sorts the queue using the 'less' comparison function, which must not be nil. This function will panic if the collection was created with a nil 'less' function (see NewIntSortedQueue).
func (*IntQueue) StableSort ¶ added in v0.8.0
func (queue *IntQueue) StableSort()
StableSort sorts the queue using the 'less' comparison function, which must not be nil. The result is stable so that repeated calls will not arbitrarily swap equal items. This function will panic if the collection was created with a nil 'less' function (see NewIntSortedQueue).
func (*IntQueue) String ¶ added in v0.8.0
String implements the Stringer interface to render the queue as a comma-separated string enclosed in square brackets.
func (*IntQueue) StringList ¶ added in v0.8.0
StringList gets a list of strings that depicts all the elements.
func (*IntQueue) Swap ¶ added in v0.8.0
Swap swaps the elements with indexes i and j. The queue must not be empty.
func (*IntQueue) ToInterfaceSlice ¶ added in v0.8.0
func (queue *IntQueue) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the queue as a slice of arbitrary type. The queue is not altered.
func (*IntQueue) ToList ¶ added in v0.9.0
ToList returns the elements of the queue as a list. The returned list is a shallow copy; the queue is not altered.
func (*IntQueue) ToSet ¶ added in v0.8.0
ToSet returns the elements of the queue as a set. The returned set is a shallow copy; the queue is not altered.
func (*IntQueue) ToSlice ¶ added in v0.8.0
ToSlice returns the elements of the queue as a slice. The queue is not altered.
func (*IntQueue) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements JSON decoding for this queue type.
type IntSequence ¶ added in v0.9.0
type IntSequence interface { IntCollection // Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last. Head() int // HeadOption gets the first element in the sequence, if possible. HeadOption() (int, bool) // Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head. Last() int // LastOption gets the last element in the sequence, if possible. LastOption() (int, bool) }
IntSequence defines an interface for sequence methods on int.
type IntSet ¶
type IntSet struct {
// contains filtered or unexported fields
}
IntSet is the primary type that represents a set.
func BuildIntSetFromChan ¶
BuildIntSetFromChan constructs a new IntSet from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertIntSet ¶
ConvertIntSet constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned set will contain all the values that were correctly converted.
func (*IntSet) Cardinality ¶
Cardinality returns how many items are currently in the set. This is a synonym for Size.
func (*IntSet) Clear ¶
func (set *IntSet) Clear()
Clear the entire set. Aterwards, it will be an empty set.
func (*IntSet) Clone ¶
Clone returns a shallow copy of the set. It does not clone the underlying elements.
func (*IntSet) Contains ¶
Contains determines whether a given item is already in the set, returning true if so.
func (*IntSet) ContainsAll ¶
ContainsAll determines whether the given items are all in the set, returning true if so.
func (*IntSet) CountBy ¶
CountBy gives the number elements of IntSet that return true for the predicate p.
func (*IntSet) Difference ¶
Difference returns a new set with items in the current set but not in the other set
func (*IntSet) Equals ¶
Equals determines whether two sets are equal to each other, returning true if so. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (*IntSet) Exists ¶
Exists applies a predicate p to every element in the set. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*IntSet) Filter ¶
Filter returns a new IntSet whose elements return true for the predicate p.
The original set is not modified
func (*IntSet) Find ¶
Find returns the first int that returns true for the predicate p. If there are many matches one is arbtrarily chosen. False is returned if none match.
func (*IntSet) FlatMap ¶
FlatMap returns a new IntSet by transforming every element with a function f that returns zero or more items in a slice. The resulting set may have a different size to the original set. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntSet) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntSet) Fold ¶ added in v0.9.0
Fold aggregates all the values in the set using a supplied function, starting from some initial value.
func (*IntSet) Forall ¶
Forall applies a predicate function p to every element in the set. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*IntSet) Foreach ¶
Foreach iterates over the set and executes the function f against each element. The function can safely alter the values via side-effects.
func (*IntSet) GobDecode ¶
GobDecode implements 'gob' decoding for this set type. You must register int with the 'gob' package before this method is used.
func (IntSet) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register int with the 'gob' package before this method is used.
func (*IntSet) IsSequence ¶
IsSequence returns true for lists and queues.
func (*IntSet) IsSubset ¶
IsSubset determines whether every item in the other set is in this set, returning true if so.
func (*IntSet) IsSuperset ¶
IsSuperset determines whether every item of this set is in the other set, returning true if so.
func (*IntSet) Map ¶
Map returns a new IntSet by transforming every element with a function f. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntSet) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntSet) MarshalJSON ¶
MarshalJSON implements JSON encoding for this set type.
func (*IntSet) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*IntSet) MaxBy ¶
MaxBy returns an element of IntSet containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*IntSet) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*IntSet) MinBy ¶
MinBy returns an element of IntSet containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*IntSet) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*IntSet) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*IntSet) Partition ¶
Partition returns two new IntSets whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original set is not modified
func (*IntSet) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed
func (*IntSet) Size ¶
Size returns how many items are currently in the set. This is a synonym for Cardinality.
func (*IntSet) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*IntSet) StringList ¶
StringSet gets a list of strings that depicts all the elements.
func (*IntSet) StringMap ¶
StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.
func (*IntSet) SymmetricDifference ¶
SymmetricDifference returns a new set with items in the current set or the other set but not in both.
func (*IntSet) ToInterfaceSlice ¶
func (set *IntSet) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.
func (*IntSet) ToList ¶
ToList returns the elements of the set as a list. The returned list is a shallow copy; the set is not altered.
func (*IntSet) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this set type.
type IntSizer ¶
type IntSizer interface { // IsEmpty tests whether IntCollection is empty. IsEmpty() bool // NonEmpty tests whether IntCollection is empty. NonEmpty() bool // Size returns the number of items in the collection - an alias of Len(). Size() int }
IntSizer defines an interface for sizing methods on int collections.
type IntStringMap ¶
type IntStringMap struct {
// contains filtered or unexported fields
}
IntStringMap is the primary type that represents a thread-safe map
func NewIntStringMap ¶
func NewIntStringMap(kv ...IntStringTuple) *IntStringMap
NewIntStringMap creates and returns a reference to a map, optionally containing some items.
func NewIntStringMap1 ¶
func NewIntStringMap1(k int, v string) *IntStringMap
NewIntStringMap1 creates and returns a reference to a map containing one item.
func (*IntStringMap) Clone ¶
func (mm *IntStringMap) Clone() *IntStringMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*IntStringMap) ContainsAllKeys ¶
func (mm *IntStringMap) ContainsAllKeys(kk ...int) bool
ContainsAllKeys determines if the given items are all in the map.
func (*IntStringMap) ContainsKey ¶
func (mm *IntStringMap) ContainsKey(k int) bool
ContainsKey determines if a given item is already in the map.
func (*IntStringMap) DropWhere ¶
func (mm *IntStringMap) DropWhere(fn func(int, string) bool) IntStringTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*IntStringMap) Equals ¶
func (mm *IntStringMap) Equals(other *IntStringMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*IntStringMap) Exists ¶
func (mm *IntStringMap) Exists(p func(int, string) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*IntStringMap) Filter ¶
func (mm *IntStringMap) Filter(p func(int, string) bool) *IntStringMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*IntStringMap) Find ¶
func (mm *IntStringMap) Find(p func(int, string) bool) (IntStringTuple, bool)
Find returns the first string that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*IntStringMap) FlatMap ¶
func (mm *IntStringMap) FlatMap(f func(int, string) []IntStringTuple) *IntStringMap
FlatMap returns a new StringMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntStringMap) Forall ¶
func (mm *IntStringMap) Forall(p func(int, string) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*IntStringMap) Foreach ¶
func (mm *IntStringMap) Foreach(f func(int, string))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*IntStringMap) Get ¶
func (mm *IntStringMap) Get(k int) (string, bool)
Get returns one of the items in the map, if present.
func (*IntStringMap) GobDecode ¶
func (mm *IntStringMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register string with the 'gob' package before this method is used.
func (*IntStringMap) GobEncode ¶
func (mm *IntStringMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register string with the 'gob' package before this method is used.
func (*IntStringMap) IsEmpty ¶
func (mm *IntStringMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*IntStringMap) Keys ¶
func (mm *IntStringMap) Keys() collection.IntList
Keys returns the keys of the current map as a slice.
func (*IntStringMap) Map ¶
func (mm *IntStringMap) Map(f func(int, string) (int, string)) *IntStringMap
Map returns a new StringMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*IntStringMap) MkString ¶
func (mm *IntStringMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*IntStringMap) MkString4 ¶ added in v0.7.0
func (mm *IntStringMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*IntStringMap) NonEmpty ¶
func (mm *IntStringMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*IntStringMap) OrderedSlice ¶
func (mm *IntStringMap) OrderedSlice(keys collection.IntList) IntStringTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*IntStringMap) Partition ¶
func (mm *IntStringMap) Partition(p func(int, string) bool) (matching *IntStringMap, others *IntStringMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*IntStringMap) Pop ¶
func (mm *IntStringMap) Pop(k int) (string, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*IntStringMap) Put ¶
func (mm *IntStringMap) Put(k int, v string) bool
Put adds an item to the current map, replacing any prior value.
func (*IntStringMap) Remove ¶
func (mm *IntStringMap) Remove(k int)
Remove a single item from the map.
func (*IntStringMap) Size ¶
func (mm *IntStringMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*IntStringMap) String ¶
func (mm *IntStringMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*IntStringMap) ToSlice ¶
func (mm *IntStringMap) ToSlice() IntStringTuples
ToSlice returns the key/value pairs as a slice
func (*IntStringMap) Values ¶
func (mm *IntStringMap) Values() collection.StringList
Values returns the values of the current map as a slice.
type IntStringTuple ¶
IntStringTuple represents a key/value pair.
func (IntStringTuple) MarshalJSON ¶
func (t IntStringTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (IntStringTuple) UnmarshalJSON ¶
func (t IntStringTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type IntStringTuples ¶
type IntStringTuples []IntStringTuple
IntStringTuples can be used as a builder for unmodifiable maps.
func IntStringZip ¶
func IntStringZip(keys ...int) IntStringTuples
IntStringZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewIntStringMap constructor function.
func (IntStringTuples) Append1 ¶
func (ts IntStringTuples) Append1(k int, v string) IntStringTuples
Append1 adds one item.
func (IntStringTuples) Append2 ¶
func (ts IntStringTuples) Append2(k1 int, v1 string, k2 int, v2 string) IntStringTuples
Append2 adds two items.
func (IntStringTuples) Append3 ¶
func (ts IntStringTuples) Append3(k1 int, v1 string, k2 int, v2 string, k3 int, v3 string) IntStringTuples
Append3 adds three items.
func (IntStringTuples) MkString ¶
func (ts IntStringTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (IntStringTuples) MkString4 ¶ added in v0.7.0
func (ts IntStringTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (IntStringTuples) String ¶
func (ts IntStringTuples) String() string
func (IntStringTuples) ToMap ¶
func (ts IntStringTuples) ToMap() *IntStringMap
ToMap converts the tuples to a map.
func (IntStringTuples) Values ¶
func (ts IntStringTuples) Values(values ...string) IntStringTuples
Values sets the values in a tuple slice. Use this with IntStringZip.
type StringAnyMap ¶
type StringAnyMap struct {
// contains filtered or unexported fields
}
StringAnyMap is the primary type that represents a thread-safe map
func NewStringAnyMap ¶
func NewStringAnyMap(kv ...StringAnyTuple) *StringAnyMap
NewStringAnyMap creates and returns a reference to a map, optionally containing some items.
func NewStringAnyMap1 ¶
func NewStringAnyMap1(k string, v interface{}) *StringAnyMap
NewStringAnyMap1 creates and returns a reference to a map containing one item.
func (*StringAnyMap) Clone ¶
func (mm *StringAnyMap) Clone() *StringAnyMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*StringAnyMap) ContainsAllKeys ¶
func (mm *StringAnyMap) ContainsAllKeys(kk ...string) bool
ContainsAllKeys determines if the given items are all in the map.
func (*StringAnyMap) ContainsKey ¶
func (mm *StringAnyMap) ContainsKey(k string) bool
ContainsKey determines if a given item is already in the map.
func (*StringAnyMap) DropWhere ¶
func (mm *StringAnyMap) DropWhere(fn func(string, interface{}) bool) StringAnyTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*StringAnyMap) Equals ¶
func (mm *StringAnyMap) Equals(other *StringAnyMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*StringAnyMap) Exists ¶
func (mm *StringAnyMap) Exists(p func(string, interface{}) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*StringAnyMap) Filter ¶
func (mm *StringAnyMap) Filter(p func(string, interface{}) bool) *StringAnyMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*StringAnyMap) Find ¶
func (mm *StringAnyMap) Find(p func(string, interface{}) bool) (StringAnyTuple, bool)
Find returns the first interface{} that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*StringAnyMap) FlatMap ¶
func (mm *StringAnyMap) FlatMap(f func(string, interface{}) []StringAnyTuple) *StringAnyMap
FlatMap returns a new AnyMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringAnyMap) Forall ¶
func (mm *StringAnyMap) Forall(p func(string, interface{}) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*StringAnyMap) Foreach ¶
func (mm *StringAnyMap) Foreach(f func(string, interface{}))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*StringAnyMap) Get ¶
func (mm *StringAnyMap) Get(k string) (interface{}, bool)
Get returns one of the items in the map, if present.
func (*StringAnyMap) GobDecode ¶
func (mm *StringAnyMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register interface{} with the 'gob' package before this method is used.
func (*StringAnyMap) GobEncode ¶
func (mm *StringAnyMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register interface{} with the 'gob' package before this method is used.
func (*StringAnyMap) IsEmpty ¶
func (mm *StringAnyMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*StringAnyMap) Keys ¶
func (mm *StringAnyMap) Keys() collection.StringList
Keys returns the keys of the current map as a slice.
func (*StringAnyMap) Map ¶
func (mm *StringAnyMap) Map(f func(string, interface{}) (string, interface{})) *StringAnyMap
Map returns a new AnyMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringAnyMap) MarshalJSON ¶
func (mm *StringAnyMap) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this map type.
func (*StringAnyMap) MkString ¶
func (mm *StringAnyMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*StringAnyMap) MkString4 ¶ added in v0.7.0
func (mm *StringAnyMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*StringAnyMap) NonEmpty ¶
func (mm *StringAnyMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*StringAnyMap) OrderedSlice ¶
func (mm *StringAnyMap) OrderedSlice(keys collection.StringList) StringAnyTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*StringAnyMap) Partition ¶
func (mm *StringAnyMap) Partition(p func(string, interface{}) bool) (matching *StringAnyMap, others *StringAnyMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*StringAnyMap) Pop ¶
func (mm *StringAnyMap) Pop(k string) (interface{}, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*StringAnyMap) Put ¶
func (mm *StringAnyMap) Put(k string, v interface{}) bool
Put adds an item to the current map, replacing any prior value.
func (*StringAnyMap) Remove ¶
func (mm *StringAnyMap) Remove(k string)
Remove a single item from the map.
func (*StringAnyMap) Size ¶
func (mm *StringAnyMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*StringAnyMap) String ¶
func (mm *StringAnyMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*StringAnyMap) ToSlice ¶
func (mm *StringAnyMap) ToSlice() StringAnyTuples
ToSlice returns the key/value pairs as a slice
func (*StringAnyMap) UnmarshalJSON ¶
func (mm *StringAnyMap) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this map type.
func (*StringAnyMap) Values ¶
func (mm *StringAnyMap) Values() collection.AnyList
Values returns the values of the current map as a slice.
type StringAnyTuple ¶
type StringAnyTuple struct { Key string Val interface{} }
StringAnyTuple represents a key/value pair.
func (StringAnyTuple) MarshalJSON ¶
func (t StringAnyTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (StringAnyTuple) UnmarshalJSON ¶
func (t StringAnyTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type StringAnyTuples ¶
type StringAnyTuples []StringAnyTuple
StringAnyTuples can be used as a builder for unmodifiable maps.
func StringAnyZip ¶
func StringAnyZip(keys ...string) StringAnyTuples
StringAnyZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewStringAnyMap constructor function.
func (StringAnyTuples) Append1 ¶
func (ts StringAnyTuples) Append1(k string, v interface{}) StringAnyTuples
Append1 adds one item.
func (StringAnyTuples) Append2 ¶
func (ts StringAnyTuples) Append2(k1 string, v1 interface{}, k2 string, v2 interface{}) StringAnyTuples
Append2 adds two items.
func (StringAnyTuples) Append3 ¶
func (ts StringAnyTuples) Append3(k1 string, v1 interface{}, k2 string, v2 interface{}, k3 string, v3 interface{}) StringAnyTuples
Append3 adds three items.
func (StringAnyTuples) MkString ¶
func (ts StringAnyTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (StringAnyTuples) MkString4 ¶ added in v0.7.0
func (ts StringAnyTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (StringAnyTuples) String ¶
func (ts StringAnyTuples) String() string
func (StringAnyTuples) ToMap ¶
func (ts StringAnyTuples) ToMap() *StringAnyMap
ToMap converts the tuples to a map.
func (StringAnyTuples) Values ¶
func (ts StringAnyTuples) Values(values ...interface{}) StringAnyTuples
Values sets the values in a tuple slice. Use this with StringAnyZip.
type StringCollection ¶
type StringCollection interface { StringSizer StringMkStringer // IsSequence returns true for lists and queues. IsSequence() bool // IsSet returns false for lists and queues. IsSet() bool // ToSlice returns a shallow copy as a plain slice. ToSlice() []string // ToInterfaceSlice returns a shallow copy as a slice of arbitrary type. ToInterfaceSlice() []interface{} // Exists verifies that one or more elements of StringCollection return true for the predicate p. Exists(p func(string) bool) bool // Forall verifies that all elements of StringCollection return true for the predicate p. Forall(p func(string) bool) bool // Foreach iterates over StringCollection and executes the function f against each element. Foreach(f func(string)) // Find returns the first string that returns true for the predicate p. // False is returned if none match. Find(p func(string) bool) (string, bool) // MapToInt returns a new []int by transforming every element with function f. // The resulting slice is the same size as the collection. The collection is not modified. MapToInt(f func(string) int) []int // FlatMapInt returns a new []int by transforming every element with function f // that returns zero or more items in a slice. The resulting slice may have a different size to the // collection. The collection is not modified. FlatMapToInt(f func(string) []int) []int // Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example. // A goroutine is created to send the elements; this only terminates when all the elements have been consumed Send() <-chan string // CountBy gives the number elements of StringCollection that return true for the predicate p. CountBy(p func(string) bool) int // Contains determines whether a given item is already in the collection, returning true if so. Contains(v string) bool // ContainsAll determines whether the given items are all in the collection, returning true if so. ContainsAll(v ...string) bool // Clear the entire collection. Clear() // Add adds items to the current collection. Add(more ...string) // MinBy returns an element of StringCollection containing the minimum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such // element is returned. Panics if there are no elements. MinBy(less func(string, string) bool) string // MaxBy returns an element of StringCollection containing the maximum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such // element is returned. Panics if there are no elements. MaxBy(less func(string, string) bool) string // Fold aggregates all the values in the collection using a supplied function, starting from some initial value. Fold(initial string, fn func(string, string) string) string }
StringCollection defines an interface for common collection methods on string.
type StringIntMap ¶
type StringIntMap struct {
// contains filtered or unexported fields
}
StringIntMap is the primary type that represents a thread-safe map
func NewStringIntMap ¶
func NewStringIntMap(kv ...StringIntTuple) *StringIntMap
NewStringIntMap creates and returns a reference to a map, optionally containing some items.
func NewStringIntMap1 ¶
func NewStringIntMap1(k string, v int) *StringIntMap
NewStringIntMap1 creates and returns a reference to a map containing one item.
func (*StringIntMap) Clone ¶
func (mm *StringIntMap) Clone() *StringIntMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*StringIntMap) ContainsAllKeys ¶
func (mm *StringIntMap) ContainsAllKeys(kk ...string) bool
ContainsAllKeys determines if the given items are all in the map.
func (*StringIntMap) ContainsKey ¶
func (mm *StringIntMap) ContainsKey(k string) bool
ContainsKey determines if a given item is already in the map.
func (*StringIntMap) DropWhere ¶
func (mm *StringIntMap) DropWhere(fn func(string, int) bool) StringIntTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*StringIntMap) Equals ¶
func (mm *StringIntMap) Equals(other *StringIntMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*StringIntMap) Exists ¶
func (mm *StringIntMap) Exists(p func(string, int) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*StringIntMap) Filter ¶
func (mm *StringIntMap) Filter(p func(string, int) bool) *StringIntMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*StringIntMap) Find ¶
func (mm *StringIntMap) Find(p func(string, int) bool) (StringIntTuple, bool)
Find returns the first int that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*StringIntMap) FlatMap ¶
func (mm *StringIntMap) FlatMap(f func(string, int) []StringIntTuple) *StringIntMap
FlatMap returns a new IntMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringIntMap) Forall ¶
func (mm *StringIntMap) Forall(p func(string, int) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*StringIntMap) Foreach ¶
func (mm *StringIntMap) Foreach(f func(string, int))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*StringIntMap) Get ¶
func (mm *StringIntMap) Get(k string) (int, bool)
Get returns one of the items in the map, if present.
func (*StringIntMap) GobDecode ¶
func (mm *StringIntMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register int with the 'gob' package before this method is used.
func (*StringIntMap) GobEncode ¶
func (mm *StringIntMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register int with the 'gob' package before this method is used.
func (*StringIntMap) IsEmpty ¶
func (mm *StringIntMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*StringIntMap) Keys ¶
func (mm *StringIntMap) Keys() collection.StringList
Keys returns the keys of the current map as a slice.
func (*StringIntMap) Map ¶
func (mm *StringIntMap) Map(f func(string, int) (string, int)) *StringIntMap
Map returns a new IntMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringIntMap) MarshalJSON ¶
func (mm *StringIntMap) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this map type.
func (*StringIntMap) MkString ¶
func (mm *StringIntMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*StringIntMap) MkString4 ¶ added in v0.7.0
func (mm *StringIntMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*StringIntMap) NonEmpty ¶
func (mm *StringIntMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*StringIntMap) OrderedSlice ¶
func (mm *StringIntMap) OrderedSlice(keys collection.StringList) StringIntTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*StringIntMap) Partition ¶
func (mm *StringIntMap) Partition(p func(string, int) bool) (matching *StringIntMap, others *StringIntMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*StringIntMap) Pop ¶
func (mm *StringIntMap) Pop(k string) (int, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*StringIntMap) Put ¶
func (mm *StringIntMap) Put(k string, v int) bool
Put adds an item to the current map, replacing any prior value.
func (*StringIntMap) Remove ¶
func (mm *StringIntMap) Remove(k string)
Remove a single item from the map.
func (*StringIntMap) Size ¶
func (mm *StringIntMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*StringIntMap) String ¶
func (mm *StringIntMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*StringIntMap) ToSlice ¶
func (mm *StringIntMap) ToSlice() StringIntTuples
ToSlice returns the key/value pairs as a slice
func (*StringIntMap) UnmarshalJSON ¶
func (mm *StringIntMap) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this map type.
func (*StringIntMap) Values ¶
func (mm *StringIntMap) Values() collection.IntList
Values returns the values of the current map as a slice.
type StringIntTuple ¶
StringIntTuple represents a key/value pair.
func (StringIntTuple) MarshalJSON ¶
func (t StringIntTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (StringIntTuple) UnmarshalJSON ¶
func (t StringIntTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type StringIntTuples ¶
type StringIntTuples []StringIntTuple
StringIntTuples can be used as a builder for unmodifiable maps.
func StringIntZip ¶
func StringIntZip(keys ...string) StringIntTuples
StringIntZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewStringIntMap constructor function.
func (StringIntTuples) Append1 ¶
func (ts StringIntTuples) Append1(k string, v int) StringIntTuples
Append1 adds one item.
func (StringIntTuples) Append2 ¶
func (ts StringIntTuples) Append2(k1 string, v1 int, k2 string, v2 int) StringIntTuples
Append2 adds two items.
func (StringIntTuples) Append3 ¶
func (ts StringIntTuples) Append3(k1 string, v1 int, k2 string, v2 int, k3 string, v3 int) StringIntTuples
Append3 adds three items.
func (StringIntTuples) MkString ¶
func (ts StringIntTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (StringIntTuples) MkString4 ¶ added in v0.7.0
func (ts StringIntTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (StringIntTuples) String ¶
func (ts StringIntTuples) String() string
func (StringIntTuples) ToMap ¶
func (ts StringIntTuples) ToMap() *StringIntMap
ToMap converts the tuples to a map.
func (StringIntTuples) Values ¶
func (ts StringIntTuples) Values(values ...int) StringIntTuples
Values sets the values in a tuple slice. Use this with StringIntZip.
type StringList ¶
type StringList struct {
// contains filtered or unexported fields
}
StringList contains a slice of type string. It encapsulates the slice and provides methods to access or mutate it.
List values follow a similar pattern to Scala Lists and LinearSeqs in particular. For comparison with Scala, see e.g. http://www.scala-lang.org/api/2.11.7/#scala.collection.LinearSeq
func BuildStringListFromChan ¶
func BuildStringListFromChan(source <-chan string) *StringList
BuildStringListFromChan constructs a new StringList from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertStringList ¶
func ConvertStringList(values ...interface{}) (*StringList, bool)
ConvertStringList constructs a new list containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned list will contain all the values that were correctly converted.
func MakeStringList ¶
func MakeStringList(length, capacity int) *StringList
MakeStringList makes an empty list with both length and capacity initialised.
func NewStringList ¶
func NewStringList(values ...string) *StringList
NewStringList constructs a new list containing the supplied values, if any.
func (*StringList) Add ¶
func (list *StringList) Add(more ...string)
Add adds items to the current list. This is a synonym for Append.
func (*StringList) Append ¶
func (list *StringList) Append(more ...string) *StringList
Append adds items to the current list. If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned.
func (*StringList) Clone ¶
func (list *StringList) Clone() *StringList
Clone returns a shallow copy of the list. It does not clone the underlying elements.
func (*StringList) Contains ¶
func (list *StringList) Contains(v string) bool
Contains determines whether a given item is already in the list, returning true if so.
func (*StringList) ContainsAll ¶
func (list *StringList) ContainsAll(i ...string) bool
ContainsAll determines whether the given items are all in the list, returning true if so. This is potentially a slow method and should only be used rarely.
func (*StringList) CountBy ¶
func (list *StringList) CountBy(p func(string) bool) (result int)
CountBy gives the number elements of StringList that return true for the predicate p.
func (*StringList) DistinctBy ¶
func (list *StringList) DistinctBy(equal func(string, string) bool) *StringList
DistinctBy returns a new StringList whose elements are unique, where equality is defined by the equal function.
func (*StringList) DoDeleteAt ¶
func (list *StringList) DoDeleteAt(index, n int) *StringList
DoDeleteAt modifies a StringList by deleting n elements from a given index.
The list is modified and the modified list is returned. Panics if the index is out of range or n is large enough to take the index out of range.
func (*StringList) DoDeleteFirst ¶
func (list *StringList) DoDeleteFirst(n int) *StringList
DoDeleteFirst modifies a StringList by deleting n elements from the start of the list.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if n is large enough to take the index out of range.
func (*StringList) DoDeleteLast ¶
func (list *StringList) DoDeleteLast(n int) *StringList
DoDeleteLast modifies a StringList by deleting n elements from the end of the list.
The list is modified and the modified list is returned. Panics if n is large enough to take the index out of range.
func (*StringList) DoInsertAt ¶
func (list *StringList) DoInsertAt(index int, more ...string) *StringList
DoInsertAt modifies a StringList by inserting elements at a given index. This is a generalised version of Append.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if the index is out of range.
func (*StringList) DoKeepWhere ¶
func (list *StringList) DoKeepWhere(p func(string) bool) *StringList
DoKeepWhere modifies a StringList by retaining only those elements that match the predicate p. This is very similar to Filter but alters the list in place.
The list is modified and the modified list is returned.
func (*StringList) DoReverse ¶
func (list *StringList) DoReverse() *StringList
DoReverse alters a StringList with all elements in the reverse order. Unlike Reverse, it does not allocate new memory.
The list is modified and the modified list is returned.
func (*StringList) DoShuffle ¶
func (list *StringList) DoShuffle() *StringList
DoShuffle returns a shuffled StringList, using a version of the Fisher-Yates shuffle.
The list is modified and the modified list is returned.
func (*StringList) Drop ¶
func (list *StringList) Drop(n int) *StringList
Drop returns a slice of StringList without the leading n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*StringList) DropLast ¶
func (list *StringList) DropLast(n int) *StringList
DropLast returns a slice of StringList without the trailing n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*StringList) DropWhile ¶
func (list *StringList) DropWhile(p func(string) bool) *StringList
DropWhile returns a new StringList containing the trailing elements of the source list. Whilst the predicate p returns true, elements are excluded from the result. Once predicate p returns false, all remaining elements are added.
The original list is not modified.
func (*StringList) Equals ¶
func (list *StringList) Equals(other *StringList) bool
Equals determines if two lists are equal to each other. If they both are the same size and have the same items in the same order, they are considered equal. Order of items is not relevent for sets to be equal. Nil lists are considered to be empty.
func (*StringList) Exists ¶
func (list *StringList) Exists(p func(string) bool) bool
Exists verifies that one or more elements of StringList return true for the predicate p.
func (*StringList) Filter ¶
func (list *StringList) Filter(p func(string) bool) *StringList
Filter returns a new StringList whose elements return true for predicate p.
The original list is not modified. See also DoKeepWhere (which does modify the original list).
func (*StringList) Find ¶
func (list *StringList) Find(p func(string) bool) (string, bool)
Find returns the first string that returns true for predicate p. False is returned if none match.
func (*StringList) FlatMap ¶
func (list *StringList) FlatMap(f func(string) []string) *StringList
FlatMap returns a new StringList by transforming every element with function f that returns zero or more items in a slice. The resulting list may have a different size to the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringList) FlatMapToInt ¶
func (list *StringList) FlatMapToInt(f func(string) []int) []int
FlatMapToInt returns a new []int by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringList) Fold ¶ added in v0.9.0
Fold aggregates all the values in the list using a supplied function, starting from some initial value.
func (*StringList) Forall ¶
func (list *StringList) Forall(p func(string) bool) bool
Forall verifies that all elements of StringList return true for the predicate p.
func (*StringList) Foreach ¶
func (list *StringList) Foreach(f func(string))
Foreach iterates over StringList and executes function f against each element. The function can safely alter the values via side-effects.
func (*StringList) Get ¶
func (list *StringList) Get(i int) string
Get gets the specified element in the list. Panics if the index is out of range or the list is nil.
func (*StringList) GobDecode ¶
func (list *StringList) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this list type. You must register string with the 'gob' package before this method is used.
func (StringList) GobEncode ¶
func (list StringList) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this list type. You must register string with the 'gob' package before this method is used.
func (*StringList) Head ¶
func (list *StringList) Head() string
Head gets the first element in the list. Head plus Tail include the whole list. Head is the opposite of Last. Panics if list is empty or nil.
func (*StringList) HeadOption ¶
func (list *StringList) HeadOption() (string, bool)
HeadOption gets the first element in the list, if possible. Otherwise returns the zero value.
func (*StringList) IndexWhere ¶
func (list *StringList) IndexWhere(p func(string) bool) int
IndexWhere finds the index of the first element satisfying predicate p. If none exists, -1 is returned.
func (*StringList) IndexWhere2 ¶
func (list *StringList) IndexWhere2(p func(string) bool, from int) int
IndexWhere2 finds the index of the first element satisfying predicate p at or after some start index. If none exists, -1 is returned.
func (*StringList) Init ¶
func (list *StringList) Init() *StringList
Init gets everything except the last. Init plus Last include the whole list. Init is the opposite of Tail. Panics if list is empty or nil.
func (*StringList) IsEmpty ¶
func (list *StringList) IsEmpty() bool
IsEmpty tests whether StringList is empty.
func (*StringList) IsSequence ¶
func (list *StringList) IsSequence() bool
IsSequence returns true for lists and queues.
func (*StringList) IsSet ¶
func (list *StringList) IsSet() bool
IsSet returns false for lists or queues.
func (*StringList) Last ¶
func (list *StringList) Last() string
Last gets the last element in the list. Init plus Last include the whole list. Last is the opposite of Head. Panics if list is empty or nil.
func (*StringList) LastIndexWhere ¶
func (list *StringList) LastIndexWhere(p func(string) bool) int
LastIndexWhere finds the index of the last element satisfying predicate p. If none exists, -1 is returned.
func (*StringList) LastIndexWhere2 ¶
func (list *StringList) LastIndexWhere2(p func(string) bool, before int) int
LastIndexWhere2 finds the index of the last element satisfying predicate p at or before some start index. If none exists, -1 is returned.
func (*StringList) LastOption ¶
func (list *StringList) LastOption() (string, bool)
LastOption gets the last element in the list, if possible. Otherwise returns the zero value.
func (*StringList) Len ¶
func (list *StringList) Len() int
Len returns the number of items in the list - an alias of Size(). This is one of the three methods in the standard sort.Interface.
func (*StringList) Map ¶
func (list *StringList) Map(f func(string) string) *StringList
Map returns a new StringList by transforming every element with function f. The resulting list is the same size as the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringList) MapToInt ¶
func (list *StringList) MapToInt(f func(string) int) []int
MapToInt returns a new []int by transforming every element with function f. The resulting slice is the same size as the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (StringList) MarshalJSON ¶
func (list StringList) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this list type.
func (*StringList) MaxBy ¶
func (list *StringList) MaxBy(less func(string, string) bool) string
MaxBy returns an element of StringList containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*StringList) MinBy ¶
func (list *StringList) MinBy(less func(string, string) bool) string
MinBy returns an element of StringList containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*StringList) MkString ¶
func (list *StringList) MkString(sep string) string
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*StringList) MkString3 ¶
func (list *StringList) MkString3(before, between, after string) string
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*StringList) NonEmpty ¶
func (list *StringList) NonEmpty() bool
NonEmpty tests whether StringList is empty.
func (*StringList) Partition ¶
func (list *StringList) Partition(p func(string) bool) (*StringList, *StringList)
Partition returns two new StringLists whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original list is not modified
func (*StringList) Reverse ¶
func (list *StringList) Reverse() *StringList
Reverse returns a copy of StringList with all elements in the reverse order.
The original list is not modified.
func (*StringList) Send ¶
func (list *StringList) Send() <-chan string
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*StringList) Shuffle ¶
func (list *StringList) Shuffle() *StringList
Shuffle returns a shuffled copy of StringList, using a version of the Fisher-Yates shuffle.
The original list is not modified.
func (*StringList) Size ¶
func (list *StringList) Size() int
Size returns the number of items in the list - an alias of Len().
func (*StringList) SortBy ¶
func (list *StringList) SortBy(less func(i, j string) bool) *StringList
SortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned.
func (*StringList) Sorted ¶
func (list *StringList) Sorted() *StringList
Sorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*StringList) StableSortBy ¶
func (list *StringList) StableSortBy(less func(i, j string) bool) *StringList
StableSortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned. The algorithm keeps the original order of equal elements.
func (*StringList) String ¶
func (list *StringList) String() string
String implements the Stringer interface to render the list as a comma-separated string enclosed in square brackets.
func (*StringList) StringList ¶
func (list *StringList) StringList() []string
StringList gets a list of strings that depicts all the elements.
func (*StringList) Swap ¶
func (list *StringList) Swap(i, j int)
Swap exchanges two elements, which is necessary during sorting etc. This is one of the three methods in the standard sort.Interface.
func (*StringList) Tail ¶
func (list *StringList) Tail() *StringList
Tail gets everything except the head. Head plus Tail include the whole list. Tail is the opposite of Init. Panics if list is empty or nil.
func (*StringList) Take ¶
func (list *StringList) Take(n int) *StringList
Take returns a slice of StringList containing the leading n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
func (*StringList) TakeLast ¶
func (list *StringList) TakeLast(n int) *StringList
TakeLast returns a slice of StringList containing the trailing n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
The original list is not modified.
func (*StringList) TakeWhile ¶
func (list *StringList) TakeWhile(p func(string) bool) *StringList
TakeWhile returns a new StringList containing the leading elements of the source list. Whilst the predicate p returns true, elements are added to the result. Once predicate p returns false, all remaining elements are excluded.
The original list is not modified.
func (*StringList) ToInterfaceSlice ¶
func (list *StringList) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current list as a slice of arbitrary type.
func (*StringList) ToList ¶
func (list *StringList) ToList() *StringList
ToList returns the elements of the list as a list, which is an identity operation in this case.
func (*StringList) ToSet ¶
func (list *StringList) ToSet() *StringSet
ToSet returns the elements of the list as a set. The returned set is a shallow copy; the list is not altered.
func (*StringList) ToSlice ¶
func (list *StringList) ToSlice() []string
ToSlice returns the elements of the current list as a slice.
func (*StringList) UnmarshalJSON ¶
func (list *StringList) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this list type.
type StringMkStringer ¶
type StringMkStringer interface { // String implements the Stringer interface to render the collection as a comma-separated string enclosed // in square brackets. String() string // MkString concatenates the values as a string using a supplied separator. No enclosing marks are added. MkString(sep string) string // MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied. MkString3(before, between, after string) string // implements json.Marshaler interface { MarshalJSON() ([]byte, error) // implements json.Unmarshaler interface { UnmarshalJSON(b []byte) error // StringList gets a collection of strings that depicts all the elements. StringList() []string }
StringMkStringer defines an interface for stringer methods on string collections.
type StringQueue ¶ added in v0.8.0
type StringQueue struct {
// contains filtered or unexported fields
}
StringQueue is a ring buffer containing a slice of type string. It is optimised for FIFO operations.
func BuildStringQueueFromChan ¶ added in v0.8.0
func BuildStringQueueFromChan(source <-chan string) *StringQueue
BuildStringQueueFromChan constructs a new StringQueue from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func NewStringQueue ¶ added in v0.8.0
func NewStringQueue(capacity int, overwrite bool) *StringQueue
NewStringQueue returns a new queue of string. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue.
func NewStringSortedQueue ¶ added in v0.8.0
func NewStringSortedQueue(capacity int, overwrite bool, less func(i, j string) bool) *StringQueue
NewStringSortedQueue returns a new queue of string. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue. If the 'less' comparison function is not nil, elements can be easily sorted.
func (*StringQueue) Add ¶ added in v0.8.0
func (queue *StringQueue) Add(more ...string)
Add adds items to the queue. This is a synonym for Push.
func (*StringQueue) Cap ¶ added in v0.8.0
func (queue *StringQueue) Cap() int
Cap gets the capacity of this queue.
func (*StringQueue) Clear ¶ added in v0.8.0
func (queue *StringQueue) Clear()
Clear the entire queue.
func (*StringQueue) Clone ¶ added in v0.8.0
func (queue *StringQueue) Clone() *StringQueue
Clone returns a shallow copy of the queue. It does not clone the underlying elements.
func (*StringQueue) Contains ¶ added in v0.8.0
func (queue *StringQueue) Contains(v string) bool
Contains determines whether a given item is already in the queue, returning true if so.
func (*StringQueue) ContainsAll ¶ added in v0.8.0
func (queue *StringQueue) ContainsAll(i ...string) bool
ContainsAll determines whether the given items are all in the queue, returning true if so. This is potentially a slow method and should only be used rarely.
func (*StringQueue) CountBy ¶ added in v0.8.0
func (queue *StringQueue) CountBy(p func(string) bool) (result int)
CountBy gives the number elements of StringQueue that return true for the predicate p.
func (*StringQueue) DoKeepWhere ¶ added in v0.8.0
func (queue *StringQueue) DoKeepWhere(p func(string) bool) *StringQueue
DoKeepWhere modifies a StringQueue by retaining only those elements that match the predicate p. This is very similar to Filter but alters the queue in place.
The queue is modified and the modified queue is returned.
func (*StringQueue) Equals ¶ added in v0.8.0
func (queue *StringQueue) Equals(other *StringQueue) bool
Equals determines if two queues are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal. Nil queues are considered to be empty.
func (*StringQueue) Exists ¶ added in v0.8.0
func (queue *StringQueue) Exists(p func(string) bool) bool
Exists verifies that one or more elements of StringQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*StringQueue) Filter ¶ added in v0.8.0
func (queue *StringQueue) Filter(p func(string) bool) *StringQueue
Filter returns a new StringQueue whose elements return true for predicate p.
The original queue is not modified. See also DoKeepWhere (which does modify the original queue).
func (*StringQueue) Find ¶ added in v0.8.0
func (queue *StringQueue) Find(p func(string) bool) (string, bool)
Find returns the first string that returns true for predicate p. False is returned if none match.
func (*StringQueue) FlatMap ¶ added in v0.8.0
func (queue *StringQueue) FlatMap(f func(string) []string) *StringQueue
FlatMap returns a new StringQueue by transforming every element with function f that returns zero or more items in a slice. The resulting queue may have a different size to the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringQueue) FlatMapToInt ¶ added in v0.8.0
func (queue *StringQueue) FlatMapToInt(f func(string) []int) []int
FlatMapToInt returns a new []int by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringQueue) Fold ¶ added in v0.9.0
Fold aggregates all the values in the queue using a supplied function, starting from some initial value.
func (*StringQueue) Forall ¶ added in v0.8.0
func (queue *StringQueue) Forall(p func(string) bool) bool
Forall verifies that all elements of StringQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*StringQueue) Foreach ¶ added in v0.8.0
func (queue *StringQueue) Foreach(f func(string))
Foreach iterates over StringQueue and executes function f against each element. The function can safely alter the values via side-effects.
func (*StringQueue) Get ¶ added in v0.8.0
func (queue *StringQueue) Get(i int) string
Get gets the specified element in the queue. Panics if the index is out of range or the queue is nil.
func (*StringQueue) Head ¶ added in v0.8.0
func (queue *StringQueue) Head() string
Head gets the first element in the queue. Head is the opposite of Last. Panics if queue is empty or nil.
func (*StringQueue) HeadOption ¶ added in v0.8.0
func (queue *StringQueue) HeadOption() (string, bool)
HeadOption returns the oldest item in the queue without removing it. If the queue is nil or empty, it returns the zero value instead.
func (*StringQueue) IsEmpty ¶ added in v0.8.0
func (queue *StringQueue) IsEmpty() bool
IsEmpty returns true if the queue is empty.
func (*StringQueue) IsFull ¶ added in v0.8.0
func (queue *StringQueue) IsFull() bool
IsFull returns true if the queue is full.
func (*StringQueue) IsOverwriting ¶ added in v0.8.0
func (queue *StringQueue) IsOverwriting() bool
IsOverwriting returns true if the queue is overwriting, false if refusing.
func (*StringQueue) IsSequence ¶ added in v0.8.0
func (queue *StringQueue) IsSequence() bool
IsSequence returns true for ordered lists and queues.
func (*StringQueue) IsSet ¶ added in v0.8.0
func (queue *StringQueue) IsSet() bool
IsSet returns false for lists or queues.
func (*StringQueue) Last ¶ added in v0.8.0
func (queue *StringQueue) Last() string
Last gets the the newest item in the queue (i.e. last element pushed) without removing it. Last is the opposite of Head. Panics if queue is empty or nil.
func (*StringQueue) LastOption ¶ added in v0.8.0
func (queue *StringQueue) LastOption() (string, bool)
LastOption returns the newest item in the queue without removing it. If the queue is nil empty, it returns the zero value instead.
func (*StringQueue) Len ¶ added in v0.8.0
func (queue *StringQueue) Len() int
Len gets the current length of this queue. This is an alias for Size.
func (*StringQueue) Less ¶ added in v0.8.0
func (queue *StringQueue) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j. The queue must have been created with a non-nil 'less' comparison function and it must not be empty.
func (*StringQueue) Map ¶ added in v0.8.0
func (queue *StringQueue) Map(f func(string) string) *StringQueue
Map returns a new StringQueue by transforming every element with function f. The resulting queue is the same size as the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringQueue) MapToInt ¶ added in v0.8.0
func (queue *StringQueue) MapToInt(f func(string) int) []int
MapToInt returns a new []int by transforming every element with function f. The resulting slice is the same size as the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (StringQueue) MarshalJSON ¶ added in v0.8.0
func (queue StringQueue) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this queue type.
func (*StringQueue) MaxBy ¶ added in v0.8.0
func (queue *StringQueue) MaxBy(less func(string, string) bool) string
MaxBy returns an element of StringQueue containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*StringQueue) MinBy ¶ added in v0.8.0
func (queue *StringQueue) MinBy(less func(string, string) bool) string
MinBy returns an element of StringQueue containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*StringQueue) MkString ¶ added in v0.8.0
func (queue *StringQueue) MkString(sep string) string
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*StringQueue) MkString3 ¶ added in v0.8.0
func (queue *StringQueue) MkString3(before, between, after string) string
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*StringQueue) NonEmpty ¶ added in v0.8.0
func (queue *StringQueue) NonEmpty() bool
NonEmpty returns true if the queue is not empty.
func (*StringQueue) Offer ¶ added in v0.8.0
func (queue *StringQueue) Offer(items ...string) []string
Offer appends as many items to the end of the queue as it can. If the queue is already full, what happens depends on whether the queue is configured to overwrite. If it is, the oldest items will be overwritten. Otherwise, it will be filled to capacity and any unwritten items are returned.
If the capacity is too small for the number of items, the excess items are returned. The queue capacity is never altered.
func (*StringQueue) Partition ¶ added in v0.8.0
func (queue *StringQueue) Partition(p func(string) bool) (*StringQueue, *StringQueue)
Partition returns two new StringQueues whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original queue.
The original queue is not modified
func (*StringQueue) Pop ¶ added in v0.8.0
func (queue *StringQueue) Pop(n int) []string
Pop removes and returns the oldest items from the queue. If the queue is empty, it returns a nil slice. If n is larger than the current queue length, it returns all the available elements, so in this case the returned slice will be shorter than n.
func (*StringQueue) Pop1 ¶ added in v0.8.0
func (queue *StringQueue) Pop1() (string, bool)
Pop1 removes and returns the oldest item from the queue. If the queue is empty, it returns the zero value instead. The boolean is true only if the element was available.
func (*StringQueue) Push ¶ added in v0.8.0
func (queue *StringQueue) Push(items ...string) *StringQueue
Push appends items to the end of the queue. If the queue does not have enough space, more will be allocated: how this happens depends on the overwriting mode.
When overwriting, the oldest items are overwritten with the new data; it expands the queue only if there is still not enough space.
Otherwise, the queue might be reallocated if necessary, ensuring that all the data is pushed without any older items being affected.
The modified queue is returned.
func (*StringQueue) Reallocate ¶ added in v0.8.0
func (queue *StringQueue) Reallocate(capacity int, overwrite bool) *StringQueue
Reallocate adjusts the allocated capacity of the queue and allows the overwriting behaviour to be changed.
If the new queue capacity is different to the current capacity, the queue is re-allocated to the new capacity. If this is less than the current number of elements, the oldest items in the queue are discarded so that the remaining data can fit in the new space available.
If the new queue capacity is the same as the current capacity, the queue is not altered except for adopting the new overwrite flag's value. Therefore this is the means to change the overwriting behaviour.
Reallocate adjusts the storage space but does not clone the underlying elements.
The queue must not be nil.
func (*StringQueue) Send ¶ added in v0.8.0
func (queue *StringQueue) Send() <-chan string
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*StringQueue) Size ¶ added in v0.8.0
func (queue *StringQueue) Size() int
Size gets the number of elements currently in this queue. This is an alias for Len.
func (*StringQueue) Sort ¶ added in v0.8.0
func (queue *StringQueue) Sort()
Sort sorts the queue using the 'less' comparison function, which must not be nil. This function will panic if the collection was created with a nil 'less' function (see NewStringSortedQueue).
func (*StringQueue) Space ¶ added in v0.8.0
func (queue *StringQueue) Space() int
Space returns the space available in the queue.
func (*StringQueue) StableSort ¶ added in v0.8.0
func (queue *StringQueue) StableSort()
StableSort sorts the queue using the 'less' comparison function, which must not be nil. The result is stable so that repeated calls will not arbitrarily swap equal items. This function will panic if the collection was created with a nil 'less' function (see NewStringSortedQueue).
func (*StringQueue) String ¶ added in v0.8.0
func (queue *StringQueue) String() string
String implements the Stringer interface to render the queue as a comma-separated string enclosed in square brackets.
func (*StringQueue) StringList ¶ added in v0.8.0
func (queue *StringQueue) StringList() []string
StringList gets a list of strings that depicts all the elements.
func (*StringQueue) Swap ¶ added in v0.8.0
func (queue *StringQueue) Swap(i, j int)
Swap swaps the elements with indexes i and j. The queue must not be empty.
func (*StringQueue) ToInterfaceSlice ¶ added in v0.8.0
func (queue *StringQueue) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the queue as a slice of arbitrary type. The queue is not altered.
func (*StringQueue) ToList ¶ added in v0.9.0
func (queue *StringQueue) ToList() *StringList
ToList returns the elements of the queue as a list. The returned list is a shallow copy; the queue is not altered.
func (*StringQueue) ToSet ¶ added in v0.8.0
func (queue *StringQueue) ToSet() *StringSet
ToSet returns the elements of the queue as a set. The returned set is a shallow copy; the queue is not altered.
func (*StringQueue) ToSlice ¶ added in v0.8.0
func (queue *StringQueue) ToSlice() []string
ToSlice returns the elements of the queue as a slice. The queue is not altered.
func (*StringQueue) UnmarshalJSON ¶ added in v0.8.0
func (queue *StringQueue) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this queue type.
type StringSequence ¶ added in v0.9.0
type StringSequence interface { StringCollection // Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last. Head() string // HeadOption gets the first element in the sequence, if possible. HeadOption() (string, bool) // Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head. Last() string // LastOption gets the last element in the sequence, if possible. LastOption() (string, bool) }
StringSequence defines an interface for sequence methods on string.
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
StringSet is the primary type that represents a set.
func BuildStringSetFromChan ¶
BuildStringSetFromChan constructs a new StringSet from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertStringSet ¶
ConvertStringSet constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned set will contain all the values that were correctly converted.
func NewStringSet ¶
NewStringSet creates and returns a reference to an empty set.
func (*StringSet) Cardinality ¶
Cardinality returns how many items are currently in the set. This is a synonym for Size.
func (*StringSet) Clear ¶
func (set *StringSet) Clear()
Clear the entire set. Aterwards, it will be an empty set.
func (*StringSet) Clone ¶
Clone returns a shallow copy of the set. It does not clone the underlying elements.
func (*StringSet) Contains ¶
Contains determines whether a given item is already in the set, returning true if so.
func (*StringSet) ContainsAll ¶
ContainsAll determines whether the given items are all in the set, returning true if so.
func (*StringSet) CountBy ¶
CountBy gives the number elements of StringSet that return true for the predicate p.
func (*StringSet) Difference ¶
Difference returns a new set with items in the current set but not in the other set
func (*StringSet) Equals ¶
Equals determines whether two sets are equal to each other, returning true if so. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (*StringSet) Exists ¶
Exists applies a predicate p to every element in the set. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*StringSet) Filter ¶
Filter returns a new StringSet whose elements return true for the predicate p.
The original set is not modified
func (*StringSet) Find ¶
Find returns the first string that returns true for the predicate p. If there are many matches one is arbtrarily chosen. False is returned if none match.
func (*StringSet) FlatMap ¶
FlatMap returns a new StringSet by transforming every element with a function f that returns zero or more items in a slice. The resulting set may have a different size to the original set. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringSet) FlatMapToInt ¶
FlatMapToInt returns a new []int by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringSet) Fold ¶ added in v0.9.0
Fold aggregates all the values in the set using a supplied function, starting from some initial value.
func (*StringSet) Forall ¶
Forall applies a predicate function p to every element in the set. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*StringSet) Foreach ¶
Foreach iterates over the set and executes the function f against each element. The function can safely alter the values via side-effects.
func (*StringSet) GobDecode ¶
GobDecode implements 'gob' decoding for this set type. You must register string with the 'gob' package before this method is used.
func (StringSet) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register string with the 'gob' package before this method is used.
func (*StringSet) IsSequence ¶
IsSequence returns true for lists and queues.
func (*StringSet) IsSubset ¶
IsSubset determines whether every item in the other set is in this set, returning true if so.
func (*StringSet) IsSuperset ¶
IsSuperset determines whether every item of this set is in the other set, returning true if so.
func (*StringSet) Map ¶
Map returns a new StringSet by transforming every element with a function f. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringSet) MapToInt ¶
MapToInt returns a new []int by transforming every element with function f. The resulting slice is the same size as the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringSet) MarshalJSON ¶
MarshalJSON implements JSON encoding for this set type.
func (*StringSet) MaxBy ¶
MaxBy returns an element of StringSet containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*StringSet) MinBy ¶
MinBy returns an element of StringSet containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*StringSet) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*StringSet) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*StringSet) Partition ¶
Partition returns two new StringSets whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original set is not modified
func (*StringSet) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed
func (*StringSet) Size ¶
Size returns how many items are currently in the set. This is a synonym for Cardinality.
func (*StringSet) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*StringSet) StringList ¶
StringSet gets a list of strings that depicts all the elements.
func (*StringSet) StringMap ¶
StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.
func (*StringSet) SymmetricDifference ¶
SymmetricDifference returns a new set with items in the current set or the other set but not in both.
func (*StringSet) ToInterfaceSlice ¶
func (set *StringSet) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.
func (*StringSet) ToList ¶
func (set *StringSet) ToList() *StringList
ToList returns the elements of the set as a list. The returned list is a shallow copy; the set is not altered.
func (*StringSet) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this set type.
type StringSizer ¶
type StringSizer interface { // IsEmpty tests whether StringCollection is empty. IsEmpty() bool // NonEmpty tests whether StringCollection is empty. NonEmpty() bool // Size returns the number of items in the collection - an alias of Len(). Size() int }
StringSizer defines an interface for sizing methods on string collections.
type StringStringMap ¶
type StringStringMap struct {
// contains filtered or unexported fields
}
StringStringMap is the primary type that represents a thread-safe map
func NewStringStringMap ¶
func NewStringStringMap(kv ...StringStringTuple) *StringStringMap
NewStringStringMap creates and returns a reference to a map, optionally containing some items.
func NewStringStringMap1 ¶
func NewStringStringMap1(k string, v string) *StringStringMap
NewStringStringMap1 creates and returns a reference to a map containing one item.
func (*StringStringMap) Clone ¶
func (mm *StringStringMap) Clone() *StringStringMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*StringStringMap) ContainsAllKeys ¶
func (mm *StringStringMap) ContainsAllKeys(kk ...string) bool
ContainsAllKeys determines if the given items are all in the map.
func (*StringStringMap) ContainsKey ¶
func (mm *StringStringMap) ContainsKey(k string) bool
ContainsKey determines if a given item is already in the map.
func (*StringStringMap) DropWhere ¶
func (mm *StringStringMap) DropWhere(fn func(string, string) bool) StringStringTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*StringStringMap) Equals ¶
func (mm *StringStringMap) Equals(other *StringStringMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*StringStringMap) Exists ¶
func (mm *StringStringMap) Exists(p func(string, string) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*StringStringMap) Filter ¶
func (mm *StringStringMap) Filter(p func(string, string) bool) *StringStringMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*StringStringMap) Find ¶
func (mm *StringStringMap) Find(p func(string, string) bool) (StringStringTuple, bool)
Find returns the first string that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*StringStringMap) FlatMap ¶
func (mm *StringStringMap) FlatMap(f func(string, string) []StringStringTuple) *StringStringMap
FlatMap returns a new StringMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringStringMap) Forall ¶
func (mm *StringStringMap) Forall(p func(string, string) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*StringStringMap) Foreach ¶
func (mm *StringStringMap) Foreach(f func(string, string))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*StringStringMap) Get ¶
func (mm *StringStringMap) Get(k string) (string, bool)
Get returns one of the items in the map, if present.
func (*StringStringMap) GobDecode ¶
func (mm *StringStringMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register string with the 'gob' package before this method is used.
func (*StringStringMap) GobEncode ¶
func (mm *StringStringMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register string with the 'gob' package before this method is used.
func (*StringStringMap) IsEmpty ¶
func (mm *StringStringMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*StringStringMap) Keys ¶
func (mm *StringStringMap) Keys() collection.StringList
Keys returns the keys of the current map as a slice.
func (*StringStringMap) Map ¶
func (mm *StringStringMap) Map(f func(string, string) (string, string)) *StringStringMap
Map returns a new StringMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringStringMap) MarshalJSON ¶
func (mm *StringStringMap) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this map type.
func (*StringStringMap) MkString ¶
func (mm *StringStringMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*StringStringMap) MkString4 ¶ added in v0.7.0
func (mm *StringStringMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*StringStringMap) NonEmpty ¶
func (mm *StringStringMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*StringStringMap) OrderedSlice ¶
func (mm *StringStringMap) OrderedSlice(keys collection.StringList) StringStringTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*StringStringMap) Partition ¶
func (mm *StringStringMap) Partition(p func(string, string) bool) (matching *StringStringMap, others *StringStringMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*StringStringMap) Pop ¶
func (mm *StringStringMap) Pop(k string) (string, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*StringStringMap) Put ¶
func (mm *StringStringMap) Put(k string, v string) bool
Put adds an item to the current map, replacing any prior value.
func (*StringStringMap) Remove ¶
func (mm *StringStringMap) Remove(k string)
Remove a single item from the map.
func (*StringStringMap) Size ¶
func (mm *StringStringMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*StringStringMap) String ¶
func (mm *StringStringMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*StringStringMap) ToSlice ¶
func (mm *StringStringMap) ToSlice() StringStringTuples
ToSlice returns the key/value pairs as a slice
func (*StringStringMap) UnmarshalJSON ¶
func (mm *StringStringMap) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this map type.
func (*StringStringMap) Values ¶
func (mm *StringStringMap) Values() collection.StringList
Values returns the values of the current map as a slice.
type StringStringTuple ¶
StringStringTuple represents a key/value pair.
func (StringStringTuple) MarshalJSON ¶
func (t StringStringTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (StringStringTuple) UnmarshalJSON ¶
func (t StringStringTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type StringStringTuples ¶
type StringStringTuples []StringStringTuple
StringStringTuples can be used as a builder for unmodifiable maps.
func StringStringZip ¶
func StringStringZip(keys ...string) StringStringTuples
StringStringZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewStringStringMap constructor function.
func (StringStringTuples) Append1 ¶
func (ts StringStringTuples) Append1(k string, v string) StringStringTuples
Append1 adds one item.
func (StringStringTuples) Append2 ¶
func (ts StringStringTuples) Append2(k1 string, v1 string, k2 string, v2 string) StringStringTuples
Append2 adds two items.
func (StringStringTuples) Append3 ¶
func (ts StringStringTuples) Append3(k1 string, v1 string, k2 string, v2 string, k3 string, v3 string) StringStringTuples
Append3 adds three items.
func (StringStringTuples) MkString ¶
func (ts StringStringTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (StringStringTuples) MkString4 ¶ added in v0.7.0
func (ts StringStringTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (StringStringTuples) String ¶
func (ts StringStringTuples) String() string
func (StringStringTuples) ToMap ¶
func (ts StringStringTuples) ToMap() *StringStringMap
ToMap converts the tuples to a map.
func (StringStringTuples) Values ¶
func (ts StringStringTuples) Values(values ...string) StringStringTuples
Values sets the values in a tuple slice. Use this with StringStringZip.
type StringUintMap ¶
type StringUintMap struct {
// contains filtered or unexported fields
}
StringUintMap is the primary type that represents a thread-safe map
func NewStringUintMap ¶
func NewStringUintMap(kv ...StringUintTuple) *StringUintMap
NewStringUintMap creates and returns a reference to a map, optionally containing some items.
func NewStringUintMap1 ¶
func NewStringUintMap1(k string, v uint) *StringUintMap
NewStringUintMap1 creates and returns a reference to a map containing one item.
func (*StringUintMap) Clone ¶
func (mm *StringUintMap) Clone() *StringUintMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*StringUintMap) ContainsAllKeys ¶
func (mm *StringUintMap) ContainsAllKeys(kk ...string) bool
ContainsAllKeys determines if the given items are all in the map.
func (*StringUintMap) ContainsKey ¶
func (mm *StringUintMap) ContainsKey(k string) bool
ContainsKey determines if a given item is already in the map.
func (*StringUintMap) DropWhere ¶
func (mm *StringUintMap) DropWhere(fn func(string, uint) bool) StringUintTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*StringUintMap) Equals ¶
func (mm *StringUintMap) Equals(other *StringUintMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*StringUintMap) Exists ¶
func (mm *StringUintMap) Exists(p func(string, uint) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*StringUintMap) Filter ¶
func (mm *StringUintMap) Filter(p func(string, uint) bool) *StringUintMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*StringUintMap) Find ¶
func (mm *StringUintMap) Find(p func(string, uint) bool) (StringUintTuple, bool)
Find returns the first uint that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*StringUintMap) FlatMap ¶
func (mm *StringUintMap) FlatMap(f func(string, uint) []StringUintTuple) *StringUintMap
FlatMap returns a new UintMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringUintMap) Forall ¶
func (mm *StringUintMap) Forall(p func(string, uint) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*StringUintMap) Foreach ¶
func (mm *StringUintMap) Foreach(f func(string, uint))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*StringUintMap) Get ¶
func (mm *StringUintMap) Get(k string) (uint, bool)
Get returns one of the items in the map, if present.
func (*StringUintMap) GobDecode ¶
func (mm *StringUintMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register uint with the 'gob' package before this method is used.
func (*StringUintMap) GobEncode ¶
func (mm *StringUintMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register uint with the 'gob' package before this method is used.
func (*StringUintMap) IsEmpty ¶
func (mm *StringUintMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*StringUintMap) Keys ¶
func (mm *StringUintMap) Keys() collection.StringList
Keys returns the keys of the current map as a slice.
func (*StringUintMap) Map ¶
func (mm *StringUintMap) Map(f func(string, uint) (string, uint)) *StringUintMap
Map returns a new UintMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*StringUintMap) MarshalJSON ¶
func (mm *StringUintMap) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this map type.
func (*StringUintMap) MkString ¶
func (mm *StringUintMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*StringUintMap) MkString4 ¶ added in v0.7.0
func (mm *StringUintMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*StringUintMap) NonEmpty ¶
func (mm *StringUintMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*StringUintMap) OrderedSlice ¶
func (mm *StringUintMap) OrderedSlice(keys collection.StringList) StringUintTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*StringUintMap) Partition ¶
func (mm *StringUintMap) Partition(p func(string, uint) bool) (matching *StringUintMap, others *StringUintMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*StringUintMap) Pop ¶
func (mm *StringUintMap) Pop(k string) (uint, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*StringUintMap) Put ¶
func (mm *StringUintMap) Put(k string, v uint) bool
Put adds an item to the current map, replacing any prior value.
func (*StringUintMap) Remove ¶
func (mm *StringUintMap) Remove(k string)
Remove a single item from the map.
func (*StringUintMap) Size ¶
func (mm *StringUintMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*StringUintMap) String ¶
func (mm *StringUintMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*StringUintMap) ToSlice ¶
func (mm *StringUintMap) ToSlice() StringUintTuples
ToSlice returns the key/value pairs as a slice
func (*StringUintMap) UnmarshalJSON ¶
func (mm *StringUintMap) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this map type.
func (*StringUintMap) Values ¶
func (mm *StringUintMap) Values() collection.UintList
Values returns the values of the current map as a slice.
type StringUintTuple ¶
StringUintTuple represents a key/value pair.
func (StringUintTuple) MarshalJSON ¶
func (t StringUintTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (StringUintTuple) UnmarshalJSON ¶
func (t StringUintTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type StringUintTuples ¶
type StringUintTuples []StringUintTuple
StringUintTuples can be used as a builder for unmodifiable maps.
func StringUintZip ¶
func StringUintZip(keys ...string) StringUintTuples
StringUintZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewStringUintMap constructor function.
func (StringUintTuples) Append1 ¶
func (ts StringUintTuples) Append1(k string, v uint) StringUintTuples
Append1 adds one item.
func (StringUintTuples) Append2 ¶
func (ts StringUintTuples) Append2(k1 string, v1 uint, k2 string, v2 uint) StringUintTuples
Append2 adds two items.
func (StringUintTuples) Append3 ¶
func (ts StringUintTuples) Append3(k1 string, v1 uint, k2 string, v2 uint, k3 string, v3 uint) StringUintTuples
Append3 adds three items.
func (StringUintTuples) MkString ¶
func (ts StringUintTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (StringUintTuples) MkString4 ¶ added in v0.7.0
func (ts StringUintTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (StringUintTuples) String ¶
func (ts StringUintTuples) String() string
func (StringUintTuples) ToMap ¶
func (ts StringUintTuples) ToMap() *StringUintMap
ToMap converts the tuples to a map.
func (StringUintTuples) Values ¶
func (ts StringUintTuples) Values(values ...uint) StringUintTuples
Values sets the values in a tuple slice. Use this with StringUintZip.
type Uint64Collection ¶
type Uint64Collection interface { Uint64Sizer Uint64MkStringer // IsSequence returns true for lists and queues. IsSequence() bool // IsSet returns false for lists and queues. IsSet() bool // ToSlice returns a shallow copy as a plain slice. ToSlice() []uint64 // ToInterfaceSlice returns a shallow copy as a slice of arbitrary type. ToInterfaceSlice() []interface{} // Exists verifies that one or more elements of Uint64Collection return true for the predicate p. Exists(p func(uint64) bool) bool // Forall verifies that all elements of Uint64Collection return true for the predicate p. Forall(p func(uint64) bool) bool // Foreach iterates over Uint64Collection and executes the function f against each element. Foreach(f func(uint64)) // Find returns the first uint64 that returns true for the predicate p. // False is returned if none match. Find(p func(uint64) bool) (uint64, bool) // MapToString returns a new []string by transforming every element with function f. // The resulting slice is the same size as the collection. The collection is not modified. MapToString(f func(uint64) string) []string // FlatMapString returns a new []string by transforming every element with function f // that returns zero or more items in a slice. The resulting slice may have a different size to the // collection. The collection is not modified. FlatMapToString(f func(uint64) []string) []string // Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example. // A goroutine is created to send the elements; this only terminates when all the elements have been consumed Send() <-chan uint64 // CountBy gives the number elements of Uint64Collection that return true for the predicate p. CountBy(p func(uint64) bool) int // Contains determines whether a given item is already in the collection, returning true if so. Contains(v uint64) bool // ContainsAll determines whether the given items are all in the collection, returning true if so. ContainsAll(v ...uint64) bool // Clear the entire collection. Clear() // Add adds items to the current collection. Add(more ...uint64) // Min returns the minimum value of all the items in the collection. Panics if there are no elements. Min() uint64 // Max returns the minimum value of all the items in the collection. Panics if there are no elements. Max() uint64 // MinBy returns an element of Uint64Collection containing the minimum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such // element is returned. Panics if there are no elements. MinBy(less func(uint64, uint64) bool) uint64 // MaxBy returns an element of Uint64Collection containing the maximum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such // element is returned. Panics if there are no elements. MaxBy(less func(uint64, uint64) bool) uint64 // Fold aggregates all the values in the collection using a supplied function, starting from some initial value. Fold(initial uint64, fn func(uint64, uint64) uint64) uint64 // Sum returns the sum of all the elements in the collection. Sum() uint64 }
Uint64Collection defines an interface for common collection methods on uint64.
type Uint64List ¶
type Uint64List struct {
// contains filtered or unexported fields
}
Uint64List contains a slice of type uint64. It encapsulates the slice and provides methods to access or mutate it.
List values follow a similar pattern to Scala Lists and LinearSeqs in particular. For comparison with Scala, see e.g. http://www.scala-lang.org/api/2.11.7/#scala.collection.LinearSeq
func BuildUint64ListFromChan ¶
func BuildUint64ListFromChan(source <-chan uint64) *Uint64List
BuildUint64ListFromChan constructs a new Uint64List from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertUint64List ¶
func ConvertUint64List(values ...interface{}) (*Uint64List, bool)
ConvertUint64List constructs a new list containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned list will contain all the values that were correctly converted. Conversions are provided from all built-in numeric types.
func MakeUint64List ¶
func MakeUint64List(length, capacity int) *Uint64List
MakeUint64List makes an empty list with both length and capacity initialised.
func NewUint64List ¶
func NewUint64List(values ...uint64) *Uint64List
NewUint64List constructs a new list containing the supplied values, if any.
func (*Uint64List) Add ¶
func (list *Uint64List) Add(more ...uint64)
Add adds items to the current list. This is a synonym for Append.
func (*Uint64List) Append ¶
func (list *Uint64List) Append(more ...uint64) *Uint64List
Append adds items to the current list. If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned.
func (*Uint64List) Clone ¶
func (list *Uint64List) Clone() *Uint64List
Clone returns a shallow copy of the list. It does not clone the underlying elements.
func (*Uint64List) Contains ¶
func (list *Uint64List) Contains(v uint64) bool
Contains determines whether a given item is already in the list, returning true if so.
func (*Uint64List) ContainsAll ¶
func (list *Uint64List) ContainsAll(i ...uint64) bool
ContainsAll determines whether the given items are all in the list, returning true if so. This is potentially a slow method and should only be used rarely.
func (*Uint64List) CountBy ¶
func (list *Uint64List) CountBy(p func(uint64) bool) (result int)
CountBy gives the number elements of Uint64List that return true for the predicate p.
func (*Uint64List) DistinctBy ¶
func (list *Uint64List) DistinctBy(equal func(uint64, uint64) bool) *Uint64List
DistinctBy returns a new Uint64List whose elements are unique, where equality is defined by the equal function.
func (*Uint64List) DoDeleteAt ¶
func (list *Uint64List) DoDeleteAt(index, n int) *Uint64List
DoDeleteAt modifies a Uint64List by deleting n elements from a given index.
The list is modified and the modified list is returned. Panics if the index is out of range or n is large enough to take the index out of range.
func (*Uint64List) DoDeleteFirst ¶
func (list *Uint64List) DoDeleteFirst(n int) *Uint64List
DoDeleteFirst modifies a Uint64List by deleting n elements from the start of the list.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if n is large enough to take the index out of range.
func (*Uint64List) DoDeleteLast ¶
func (list *Uint64List) DoDeleteLast(n int) *Uint64List
DoDeleteLast modifies a Uint64List by deleting n elements from the end of the list.
The list is modified and the modified list is returned. Panics if n is large enough to take the index out of range.
func (*Uint64List) DoInsertAt ¶
func (list *Uint64List) DoInsertAt(index int, more ...uint64) *Uint64List
DoInsertAt modifies a Uint64List by inserting elements at a given index. This is a generalised version of Append.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if the index is out of range.
func (*Uint64List) DoKeepWhere ¶
func (list *Uint64List) DoKeepWhere(p func(uint64) bool) *Uint64List
DoKeepWhere modifies a Uint64List by retaining only those elements that match the predicate p. This is very similar to Filter but alters the list in place.
The list is modified and the modified list is returned.
func (*Uint64List) DoReverse ¶
func (list *Uint64List) DoReverse() *Uint64List
DoReverse alters a Uint64List with all elements in the reverse order. Unlike Reverse, it does not allocate new memory.
The list is modified and the modified list is returned.
func (*Uint64List) DoShuffle ¶
func (list *Uint64List) DoShuffle() *Uint64List
DoShuffle returns a shuffled Uint64List, using a version of the Fisher-Yates shuffle.
The list is modified and the modified list is returned.
func (*Uint64List) Drop ¶
func (list *Uint64List) Drop(n int) *Uint64List
Drop returns a slice of Uint64List without the leading n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*Uint64List) DropLast ¶
func (list *Uint64List) DropLast(n int) *Uint64List
DropLast returns a slice of Uint64List without the trailing n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*Uint64List) DropWhile ¶
func (list *Uint64List) DropWhile(p func(uint64) bool) *Uint64List
DropWhile returns a new Uint64List containing the trailing elements of the source list. Whilst the predicate p returns true, elements are excluded from the result. Once predicate p returns false, all remaining elements are added.
The original list is not modified.
func (*Uint64List) Equals ¶
func (list *Uint64List) Equals(other *Uint64List) bool
Equals determines if two lists are equal to each other. If they both are the same size and have the same items in the same order, they are considered equal. Order of items is not relevent for sets to be equal. Nil lists are considered to be empty.
func (*Uint64List) Exists ¶
func (list *Uint64List) Exists(p func(uint64) bool) bool
Exists verifies that one or more elements of Uint64List return true for the predicate p.
func (*Uint64List) Filter ¶
func (list *Uint64List) Filter(p func(uint64) bool) *Uint64List
Filter returns a new Uint64List whose elements return true for predicate p.
The original list is not modified. See also DoKeepWhere (which does modify the original list).
func (*Uint64List) Find ¶
func (list *Uint64List) Find(p func(uint64) bool) (uint64, bool)
Find returns the first uint64 that returns true for predicate p. False is returned if none match.
func (*Uint64List) FlatMap ¶
func (list *Uint64List) FlatMap(f func(uint64) []uint64) *Uint64List
FlatMap returns a new Uint64List by transforming every element with function f that returns zero or more items in a slice. The resulting list may have a different size to the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64List) FlatMapToString ¶
func (list *Uint64List) FlatMapToString(f func(uint64) []string) []string
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64List) Fold ¶ added in v0.9.0
Fold aggregates all the values in the list using a supplied function, starting from some initial value.
func (*Uint64List) Forall ¶
func (list *Uint64List) Forall(p func(uint64) bool) bool
Forall verifies that all elements of Uint64List return true for the predicate p.
func (*Uint64List) Foreach ¶
func (list *Uint64List) Foreach(f func(uint64))
Foreach iterates over Uint64List and executes function f against each element. The function can safely alter the values via side-effects.
func (*Uint64List) Get ¶
func (list *Uint64List) Get(i int) uint64
Get gets the specified element in the list. Panics if the index is out of range or the list is nil.
func (*Uint64List) GobDecode ¶
func (list *Uint64List) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this list type. You must register uint64 with the 'gob' package before this method is used.
func (Uint64List) GobEncode ¶
func (list Uint64List) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this list type. You must register uint64 with the 'gob' package before this method is used.
func (*Uint64List) Head ¶
func (list *Uint64List) Head() uint64
Head gets the first element in the list. Head plus Tail include the whole list. Head is the opposite of Last. Panics if list is empty or nil.
func (*Uint64List) HeadOption ¶
func (list *Uint64List) HeadOption() (uint64, bool)
HeadOption gets the first element in the list, if possible. Otherwise returns the zero value.
func (*Uint64List) IndexWhere ¶
func (list *Uint64List) IndexWhere(p func(uint64) bool) int
IndexWhere finds the index of the first element satisfying predicate p. If none exists, -1 is returned.
func (*Uint64List) IndexWhere2 ¶
func (list *Uint64List) IndexWhere2(p func(uint64) bool, from int) int
IndexWhere2 finds the index of the first element satisfying predicate p at or after some start index. If none exists, -1 is returned.
func (*Uint64List) Init ¶
func (list *Uint64List) Init() *Uint64List
Init gets everything except the last. Init plus Last include the whole list. Init is the opposite of Tail. Panics if list is empty or nil.
func (*Uint64List) IsEmpty ¶
func (list *Uint64List) IsEmpty() bool
IsEmpty tests whether Uint64List is empty.
func (*Uint64List) IsSequence ¶
func (list *Uint64List) IsSequence() bool
IsSequence returns true for lists and queues.
func (*Uint64List) IsSet ¶
func (list *Uint64List) IsSet() bool
IsSet returns false for lists or queues.
func (*Uint64List) Last ¶
func (list *Uint64List) Last() uint64
Last gets the last element in the list. Init plus Last include the whole list. Last is the opposite of Head. Panics if list is empty or nil.
func (*Uint64List) LastIndexWhere ¶
func (list *Uint64List) LastIndexWhere(p func(uint64) bool) int
LastIndexWhere finds the index of the last element satisfying predicate p. If none exists, -1 is returned.
func (*Uint64List) LastIndexWhere2 ¶
func (list *Uint64List) LastIndexWhere2(p func(uint64) bool, before int) int
LastIndexWhere2 finds the index of the last element satisfying predicate p at or before some start index. If none exists, -1 is returned.
func (*Uint64List) LastOption ¶
func (list *Uint64List) LastOption() (uint64, bool)
LastOption gets the last element in the list, if possible. Otherwise returns the zero value.
func (*Uint64List) Len ¶
func (list *Uint64List) Len() int
Len returns the number of items in the list - an alias of Size(). This is one of the three methods in the standard sort.Interface.
func (*Uint64List) Map ¶
func (list *Uint64List) Map(f func(uint64) uint64) *Uint64List
Map returns a new Uint64List by transforming every element with function f. The resulting list is the same size as the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64List) MapToString ¶
func (list *Uint64List) MapToString(f func(uint64) string) []string
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (Uint64List) MarshalJSON ¶
func (list Uint64List) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this list type.
func (*Uint64List) Max ¶
func (list *Uint64List) Max() (result uint64)
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*Uint64List) MaxBy ¶
func (list *Uint64List) MaxBy(less func(uint64, uint64) bool) uint64
MaxBy returns an element of Uint64List containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*Uint64List) Min ¶
func (list *Uint64List) Min() uint64
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*Uint64List) MinBy ¶
func (list *Uint64List) MinBy(less func(uint64, uint64) bool) uint64
MinBy returns an element of Uint64List containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*Uint64List) MkString ¶
func (list *Uint64List) MkString(sep string) string
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*Uint64List) MkString3 ¶
func (list *Uint64List) MkString3(before, between, after string) string
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*Uint64List) NonEmpty ¶
func (list *Uint64List) NonEmpty() bool
NonEmpty tests whether Uint64List is empty.
func (*Uint64List) Partition ¶
func (list *Uint64List) Partition(p func(uint64) bool) (*Uint64List, *Uint64List)
Partition returns two new Uint64Lists whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original list is not modified
func (*Uint64List) Reverse ¶
func (list *Uint64List) Reverse() *Uint64List
Reverse returns a copy of Uint64List with all elements in the reverse order.
The original list is not modified.
func (*Uint64List) Send ¶
func (list *Uint64List) Send() <-chan uint64
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*Uint64List) Shuffle ¶
func (list *Uint64List) Shuffle() *Uint64List
Shuffle returns a shuffled copy of Uint64List, using a version of the Fisher-Yates shuffle.
The original list is not modified.
func (*Uint64List) Size ¶
func (list *Uint64List) Size() int
Size returns the number of items in the list - an alias of Len().
func (*Uint64List) SortBy ¶
func (list *Uint64List) SortBy(less func(i, j uint64) bool) *Uint64List
SortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned.
func (*Uint64List) Sorted ¶
func (list *Uint64List) Sorted() *Uint64List
Sorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*Uint64List) StableSortBy ¶
func (list *Uint64List) StableSortBy(less func(i, j uint64) bool) *Uint64List
StableSortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned. The algorithm keeps the original order of equal elements.
func (*Uint64List) StableSorted ¶
func (list *Uint64List) StableSorted() *Uint64List
StableSorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*Uint64List) String ¶
func (list *Uint64List) String() string
String implements the Stringer interface to render the list as a comma-separated string enclosed in square brackets.
func (*Uint64List) StringList ¶
func (list *Uint64List) StringList() []string
StringList gets a list of strings that depicts all the elements.
func (*Uint64List) Sum ¶
func (list *Uint64List) Sum() uint64
Sum returns the sum of all the elements in the list.
func (*Uint64List) Swap ¶
func (list *Uint64List) Swap(i, j int)
Swap exchanges two elements, which is necessary during sorting etc. This is one of the three methods in the standard sort.Interface.
func (*Uint64List) Tail ¶
func (list *Uint64List) Tail() *Uint64List
Tail gets everything except the head. Head plus Tail include the whole list. Tail is the opposite of Init. Panics if list is empty or nil.
func (*Uint64List) Take ¶
func (list *Uint64List) Take(n int) *Uint64List
Take returns a slice of Uint64List containing the leading n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
func (*Uint64List) TakeLast ¶
func (list *Uint64List) TakeLast(n int) *Uint64List
TakeLast returns a slice of Uint64List containing the trailing n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
The original list is not modified.
func (*Uint64List) TakeWhile ¶
func (list *Uint64List) TakeWhile(p func(uint64) bool) *Uint64List
TakeWhile returns a new Uint64List containing the leading elements of the source list. Whilst the predicate p returns true, elements are added to the result. Once predicate p returns false, all remaining elements are excluded.
The original list is not modified.
func (*Uint64List) ToInterfaceSlice ¶
func (list *Uint64List) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current list as a slice of arbitrary type.
func (*Uint64List) ToList ¶
func (list *Uint64List) ToList() *Uint64List
ToList returns the elements of the list as a list, which is an identity operation in this case.
func (*Uint64List) ToSet ¶
func (list *Uint64List) ToSet() *Uint64Set
ToSet returns the elements of the list as a set. The returned set is a shallow copy; the list is not altered.
func (*Uint64List) ToSlice ¶
func (list *Uint64List) ToSlice() []uint64
ToSlice returns the elements of the current list as a slice.
func (*Uint64List) UnmarshalJSON ¶
func (list *Uint64List) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this list type.
type Uint64MkStringer ¶
type Uint64MkStringer interface { // String implements the Stringer interface to render the collection as a comma-separated string enclosed // in square brackets. String() string // MkString concatenates the values as a string using a supplied separator. No enclosing marks are added. MkString(sep string) string // MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied. MkString3(before, between, after string) string // implements json.Marshaler interface { MarshalJSON() ([]byte, error) // implements json.Unmarshaler interface { UnmarshalJSON(b []byte) error // StringList gets a collection of strings that depicts all the elements. StringList() []string }
Uint64MkStringer defines an interface for stringer methods on uint64 collections.
type Uint64Queue ¶ added in v0.8.0
type Uint64Queue struct {
// contains filtered or unexported fields
}
Uint64Queue is a ring buffer containing a slice of type uint64. It is optimised for FIFO operations.
func BuildUint64QueueFromChan ¶ added in v0.8.0
func BuildUint64QueueFromChan(source <-chan uint64) *Uint64Queue
BuildUint64QueueFromChan constructs a new Uint64Queue from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func NewUint64Queue ¶ added in v0.8.0
func NewUint64Queue(capacity int, overwrite bool) *Uint64Queue
NewUint64Queue returns a new queue of uint64. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue.
func NewUint64SortedQueue ¶ added in v0.8.0
func NewUint64SortedQueue(capacity int, overwrite bool, less func(i, j uint64) bool) *Uint64Queue
NewUint64SortedQueue returns a new queue of uint64. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue. If the 'less' comparison function is not nil, elements can be easily sorted.
func (*Uint64Queue) Add ¶ added in v0.8.0
func (queue *Uint64Queue) Add(more ...uint64)
Add adds items to the queue. This is a synonym for Push.
func (*Uint64Queue) Cap ¶ added in v0.8.0
func (queue *Uint64Queue) Cap() int
Cap gets the capacity of this queue.
func (*Uint64Queue) Clear ¶ added in v0.8.0
func (queue *Uint64Queue) Clear()
Clear the entire queue.
func (*Uint64Queue) Clone ¶ added in v0.8.0
func (queue *Uint64Queue) Clone() *Uint64Queue
Clone returns a shallow copy of the queue. It does not clone the underlying elements.
func (*Uint64Queue) Contains ¶ added in v0.8.0
func (queue *Uint64Queue) Contains(v uint64) bool
Contains determines whether a given item is already in the queue, returning true if so.
func (*Uint64Queue) ContainsAll ¶ added in v0.8.0
func (queue *Uint64Queue) ContainsAll(i ...uint64) bool
ContainsAll determines whether the given items are all in the queue, returning true if so. This is potentially a slow method and should only be used rarely.
func (*Uint64Queue) CountBy ¶ added in v0.8.0
func (queue *Uint64Queue) CountBy(p func(uint64) bool) (result int)
CountBy gives the number elements of Uint64Queue that return true for the predicate p.
func (*Uint64Queue) DoKeepWhere ¶ added in v0.8.0
func (queue *Uint64Queue) DoKeepWhere(p func(uint64) bool) *Uint64Queue
DoKeepWhere modifies a Uint64Queue by retaining only those elements that match the predicate p. This is very similar to Filter but alters the queue in place.
The queue is modified and the modified queue is returned.
func (*Uint64Queue) Equals ¶ added in v0.8.0
func (queue *Uint64Queue) Equals(other *Uint64Queue) bool
Equals determines if two queues are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal. Nil queues are considered to be empty.
func (*Uint64Queue) Exists ¶ added in v0.8.0
func (queue *Uint64Queue) Exists(p func(uint64) bool) bool
Exists verifies that one or more elements of Uint64Queue return true for the predicate p. The function should not alter the values via side-effects.
func (*Uint64Queue) Filter ¶ added in v0.8.0
func (queue *Uint64Queue) Filter(p func(uint64) bool) *Uint64Queue
Filter returns a new Uint64Queue whose elements return true for predicate p.
The original queue is not modified. See also DoKeepWhere (which does modify the original queue).
func (*Uint64Queue) Find ¶ added in v0.8.0
func (queue *Uint64Queue) Find(p func(uint64) bool) (uint64, bool)
Find returns the first uint64 that returns true for predicate p. False is returned if none match.
func (*Uint64Queue) FlatMap ¶ added in v0.8.0
func (queue *Uint64Queue) FlatMap(f func(uint64) []uint64) *Uint64Queue
FlatMap returns a new Uint64Queue by transforming every element with function f that returns zero or more items in a slice. The resulting queue may have a different size to the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Queue) FlatMapToString ¶ added in v0.8.0
func (queue *Uint64Queue) FlatMapToString(f func(uint64) []string) []string
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Queue) Fold ¶ added in v0.9.0
Fold aggregates all the values in the queue using a supplied function, starting from some initial value.
func (*Uint64Queue) Forall ¶ added in v0.8.0
func (queue *Uint64Queue) Forall(p func(uint64) bool) bool
Forall verifies that all elements of Uint64Queue return true for the predicate p. The function should not alter the values via side-effects.
func (*Uint64Queue) Foreach ¶ added in v0.8.0
func (queue *Uint64Queue) Foreach(f func(uint64))
Foreach iterates over Uint64Queue and executes function f against each element. The function can safely alter the values via side-effects.
func (*Uint64Queue) Get ¶ added in v0.8.0
func (queue *Uint64Queue) Get(i int) uint64
Get gets the specified element in the queue. Panics if the index is out of range or the queue is nil.
func (*Uint64Queue) Head ¶ added in v0.8.0
func (queue *Uint64Queue) Head() uint64
Head gets the first element in the queue. Head is the opposite of Last. Panics if queue is empty or nil.
func (*Uint64Queue) HeadOption ¶ added in v0.8.0
func (queue *Uint64Queue) HeadOption() (uint64, bool)
HeadOption returns the oldest item in the queue without removing it. If the queue is nil or empty, it returns the zero value instead.
func (*Uint64Queue) IsEmpty ¶ added in v0.8.0
func (queue *Uint64Queue) IsEmpty() bool
IsEmpty returns true if the queue is empty.
func (*Uint64Queue) IsFull ¶ added in v0.8.0
func (queue *Uint64Queue) IsFull() bool
IsFull returns true if the queue is full.
func (*Uint64Queue) IsOverwriting ¶ added in v0.8.0
func (queue *Uint64Queue) IsOverwriting() bool
IsOverwriting returns true if the queue is overwriting, false if refusing.
func (*Uint64Queue) IsSequence ¶ added in v0.8.0
func (queue *Uint64Queue) IsSequence() bool
IsSequence returns true for ordered lists and queues.
func (*Uint64Queue) IsSet ¶ added in v0.8.0
func (queue *Uint64Queue) IsSet() bool
IsSet returns false for lists or queues.
func (*Uint64Queue) Last ¶ added in v0.8.0
func (queue *Uint64Queue) Last() uint64
Last gets the the newest item in the queue (i.e. last element pushed) without removing it. Last is the opposite of Head. Panics if queue is empty or nil.
func (*Uint64Queue) LastOption ¶ added in v0.8.0
func (queue *Uint64Queue) LastOption() (uint64, bool)
LastOption returns the newest item in the queue without removing it. If the queue is nil empty, it returns the zero value instead.
func (*Uint64Queue) Len ¶ added in v0.8.0
func (queue *Uint64Queue) Len() int
Len gets the current length of this queue. This is an alias for Size.
func (*Uint64Queue) Less ¶ added in v0.8.0
func (queue *Uint64Queue) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j. The queue must have been created with a non-nil 'less' comparison function and it must not be empty.
func (*Uint64Queue) Map ¶ added in v0.8.0
func (queue *Uint64Queue) Map(f func(uint64) uint64) *Uint64Queue
Map returns a new Uint64Queue by transforming every element with function f. The resulting queue is the same size as the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Queue) MapToString ¶ added in v0.8.0
func (queue *Uint64Queue) MapToString(f func(uint64) string) []string
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (Uint64Queue) MarshalJSON ¶ added in v0.8.0
func (queue Uint64Queue) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding for this queue type.
func (*Uint64Queue) Max ¶ added in v0.8.0
func (queue *Uint64Queue) Max() (result uint64)
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*Uint64Queue) MaxBy ¶ added in v0.8.0
func (queue *Uint64Queue) MaxBy(less func(uint64, uint64) bool) uint64
MaxBy returns an element of Uint64Queue containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*Uint64Queue) Min ¶ added in v0.8.0
func (queue *Uint64Queue) Min() uint64
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*Uint64Queue) MinBy ¶ added in v0.8.0
func (queue *Uint64Queue) MinBy(less func(uint64, uint64) bool) uint64
MinBy returns an element of Uint64Queue containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*Uint64Queue) MkString ¶ added in v0.8.0
func (queue *Uint64Queue) MkString(sep string) string
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*Uint64Queue) MkString3 ¶ added in v0.8.0
func (queue *Uint64Queue) MkString3(before, between, after string) string
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*Uint64Queue) NonEmpty ¶ added in v0.8.0
func (queue *Uint64Queue) NonEmpty() bool
NonEmpty returns true if the queue is not empty.
func (*Uint64Queue) Offer ¶ added in v0.8.0
func (queue *Uint64Queue) Offer(items ...uint64) []uint64
Offer appends as many items to the end of the queue as it can. If the queue is already full, what happens depends on whether the queue is configured to overwrite. If it is, the oldest items will be overwritten. Otherwise, it will be filled to capacity and any unwritten items are returned.
If the capacity is too small for the number of items, the excess items are returned. The queue capacity is never altered.
func (*Uint64Queue) Partition ¶ added in v0.8.0
func (queue *Uint64Queue) Partition(p func(uint64) bool) (*Uint64Queue, *Uint64Queue)
Partition returns two new Uint64Queues whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original queue.
The original queue is not modified
func (*Uint64Queue) Pop ¶ added in v0.8.0
func (queue *Uint64Queue) Pop(n int) []uint64
Pop removes and returns the oldest items from the queue. If the queue is empty, it returns a nil slice. If n is larger than the current queue length, it returns all the available elements, so in this case the returned slice will be shorter than n.
func (*Uint64Queue) Pop1 ¶ added in v0.8.0
func (queue *Uint64Queue) Pop1() (uint64, bool)
Pop1 removes and returns the oldest item from the queue. If the queue is empty, it returns the zero value instead. The boolean is true only if the element was available.
func (*Uint64Queue) Push ¶ added in v0.8.0
func (queue *Uint64Queue) Push(items ...uint64) *Uint64Queue
Push appends items to the end of the queue. If the queue does not have enough space, more will be allocated: how this happens depends on the overwriting mode.
When overwriting, the oldest items are overwritten with the new data; it expands the queue only if there is still not enough space.
Otherwise, the queue might be reallocated if necessary, ensuring that all the data is pushed without any older items being affected.
The modified queue is returned.
func (*Uint64Queue) Reallocate ¶ added in v0.8.0
func (queue *Uint64Queue) Reallocate(capacity int, overwrite bool) *Uint64Queue
Reallocate adjusts the allocated capacity of the queue and allows the overwriting behaviour to be changed.
If the new queue capacity is different to the current capacity, the queue is re-allocated to the new capacity. If this is less than the current number of elements, the oldest items in the queue are discarded so that the remaining data can fit in the new space available.
If the new queue capacity is the same as the current capacity, the queue is not altered except for adopting the new overwrite flag's value. Therefore this is the means to change the overwriting behaviour.
Reallocate adjusts the storage space but does not clone the underlying elements.
The queue must not be nil.
func (*Uint64Queue) Send ¶ added in v0.8.0
func (queue *Uint64Queue) Send() <-chan uint64
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*Uint64Queue) Size ¶ added in v0.8.0
func (queue *Uint64Queue) Size() int
Size gets the number of elements currently in this queue. This is an alias for Len.
func (*Uint64Queue) Sort ¶ added in v0.8.0
func (queue *Uint64Queue) Sort()
Sort sorts the queue using the 'less' comparison function, which must not be nil. This function will panic if the collection was created with a nil 'less' function (see NewUint64SortedQueue).
func (*Uint64Queue) Space ¶ added in v0.8.0
func (queue *Uint64Queue) Space() int
Space returns the space available in the queue.
func (*Uint64Queue) StableSort ¶ added in v0.8.0
func (queue *Uint64Queue) StableSort()
StableSort sorts the queue using the 'less' comparison function, which must not be nil. The result is stable so that repeated calls will not arbitrarily swap equal items. This function will panic if the collection was created with a nil 'less' function (see NewUint64SortedQueue).
func (*Uint64Queue) String ¶ added in v0.8.0
func (queue *Uint64Queue) String() string
String implements the Stringer interface to render the queue as a comma-separated string enclosed in square brackets.
func (*Uint64Queue) StringList ¶ added in v0.8.0
func (queue *Uint64Queue) StringList() []string
StringList gets a list of strings that depicts all the elements.
func (*Uint64Queue) Sum ¶ added in v0.8.0
func (queue *Uint64Queue) Sum() uint64
Sum returns the sum of all the elements in the queue.
func (*Uint64Queue) Swap ¶ added in v0.8.0
func (queue *Uint64Queue) Swap(i, j int)
Swap swaps the elements with indexes i and j. The queue must not be empty.
func (*Uint64Queue) ToInterfaceSlice ¶ added in v0.8.0
func (queue *Uint64Queue) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the queue as a slice of arbitrary type. The queue is not altered.
func (*Uint64Queue) ToList ¶ added in v0.9.0
func (queue *Uint64Queue) ToList() *Uint64List
ToList returns the elements of the queue as a list. The returned list is a shallow copy; the queue is not altered.
func (*Uint64Queue) ToSet ¶ added in v0.8.0
func (queue *Uint64Queue) ToSet() *Uint64Set
ToSet returns the elements of the queue as a set. The returned set is a shallow copy; the queue is not altered.
func (*Uint64Queue) ToSlice ¶ added in v0.8.0
func (queue *Uint64Queue) ToSlice() []uint64
ToSlice returns the elements of the queue as a slice. The queue is not altered.
func (*Uint64Queue) UnmarshalJSON ¶ added in v0.8.0
func (queue *Uint64Queue) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this queue type.
type Uint64Sequence ¶ added in v0.9.0
type Uint64Sequence interface { Uint64Collection // Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last. Head() uint64 // HeadOption gets the first element in the sequence, if possible. HeadOption() (uint64, bool) // Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head. Last() uint64 // LastOption gets the last element in the sequence, if possible. LastOption() (uint64, bool) }
Uint64Sequence defines an interface for sequence methods on uint64.
type Uint64Set ¶
type Uint64Set struct {
// contains filtered or unexported fields
}
Uint64Set is the primary type that represents a set.
func BuildUint64SetFromChan ¶
BuildUint64SetFromChan constructs a new Uint64Set from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertUint64Set ¶
ConvertUint64Set constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned set will contain all the values that were correctly converted.
func NewUint64Set ¶
NewUint64Set creates and returns a reference to an empty set.
func (*Uint64Set) Cardinality ¶
Cardinality returns how many items are currently in the set. This is a synonym for Size.
func (*Uint64Set) Clear ¶
func (set *Uint64Set) Clear()
Clear the entire set. Aterwards, it will be an empty set.
func (*Uint64Set) Clone ¶
Clone returns a shallow copy of the set. It does not clone the underlying elements.
func (*Uint64Set) Contains ¶
Contains determines whether a given item is already in the set, returning true if so.
func (*Uint64Set) ContainsAll ¶
ContainsAll determines whether the given items are all in the set, returning true if so.
func (*Uint64Set) CountBy ¶
CountBy gives the number elements of Uint64Set that return true for the predicate p.
func (*Uint64Set) Difference ¶
Difference returns a new set with items in the current set but not in the other set
func (*Uint64Set) Equals ¶
Equals determines whether two sets are equal to each other, returning true if so. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (*Uint64Set) Exists ¶
Exists applies a predicate p to every element in the set. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*Uint64Set) Filter ¶
Filter returns a new Uint64Set whose elements return true for the predicate p.
The original set is not modified
func (*Uint64Set) Find ¶
Find returns the first uint64 that returns true for the predicate p. If there are many matches one is arbtrarily chosen. False is returned if none match.
func (*Uint64Set) FlatMap ¶
FlatMap returns a new Uint64Set by transforming every element with a function f that returns zero or more items in a slice. The resulting set may have a different size to the original set. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Set) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Set) Fold ¶ added in v0.9.0
Fold aggregates all the values in the set using a supplied function, starting from some initial value.
func (*Uint64Set) Forall ¶
Forall applies a predicate function p to every element in the set. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*Uint64Set) Foreach ¶
Foreach iterates over the set and executes the function f against each element. The function can safely alter the values via side-effects.
func (*Uint64Set) GobDecode ¶
GobDecode implements 'gob' decoding for this set type. You must register uint64 with the 'gob' package before this method is used.
func (Uint64Set) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register uint64 with the 'gob' package before this method is used.
func (*Uint64Set) IsSequence ¶
IsSequence returns true for lists and queues.
func (*Uint64Set) IsSubset ¶
IsSubset determines whether every item in the other set is in this set, returning true if so.
func (*Uint64Set) IsSuperset ¶
IsSuperset determines whether every item of this set is in the other set, returning true if so.
func (*Uint64Set) Map ¶
Map returns a new Uint64Set by transforming every element with a function f. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Set) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Set) MarshalJSON ¶
MarshalJSON implements JSON encoding for this set type.
func (*Uint64Set) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*Uint64Set) MaxBy ¶
MaxBy returns an element of Uint64Set containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*Uint64Set) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*Uint64Set) MinBy ¶
MinBy returns an element of Uint64Set containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*Uint64Set) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*Uint64Set) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*Uint64Set) Partition ¶
Partition returns two new Uint64Sets whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original set is not modified
func (*Uint64Set) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed
func (*Uint64Set) Size ¶
Size returns how many items are currently in the set. This is a synonym for Cardinality.
func (*Uint64Set) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*Uint64Set) StringList ¶
StringSet gets a list of strings that depicts all the elements.
func (*Uint64Set) StringMap ¶
StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.
func (*Uint64Set) SymmetricDifference ¶
SymmetricDifference returns a new set with items in the current set or the other set but not in both.
func (*Uint64Set) ToInterfaceSlice ¶
func (set *Uint64Set) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.
func (*Uint64Set) ToList ¶
func (set *Uint64Set) ToList() *Uint64List
ToList returns the elements of the set as a list. The returned list is a shallow copy; the set is not altered.
func (*Uint64Set) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this set type.
type Uint64Sizer ¶
type Uint64Sizer interface { // IsEmpty tests whether Uint64Collection is empty. IsEmpty() bool // NonEmpty tests whether Uint64Collection is empty. NonEmpty() bool // Size returns the number of items in the collection - an alias of Len(). Size() int }
Uint64Sizer defines an interface for sizing methods on uint64 collections.
type Uint64StringMap ¶
type Uint64StringMap struct {
// contains filtered or unexported fields
}
Uint64StringMap is the primary type that represents a thread-safe map
func NewUint64StringMap ¶
func NewUint64StringMap(kv ...Uint64StringTuple) *Uint64StringMap
NewUint64StringMap creates and returns a reference to a map, optionally containing some items.
func NewUint64StringMap1 ¶
func NewUint64StringMap1(k uint64, v string) *Uint64StringMap
NewUint64StringMap1 creates and returns a reference to a map containing one item.
func (*Uint64StringMap) Clone ¶
func (mm *Uint64StringMap) Clone() *Uint64StringMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*Uint64StringMap) ContainsAllKeys ¶
func (mm *Uint64StringMap) ContainsAllKeys(kk ...uint64) bool
ContainsAllKeys determines if the given items are all in the map.
func (*Uint64StringMap) ContainsKey ¶
func (mm *Uint64StringMap) ContainsKey(k uint64) bool
ContainsKey determines if a given item is already in the map.
func (*Uint64StringMap) DropWhere ¶
func (mm *Uint64StringMap) DropWhere(fn func(uint64, string) bool) Uint64StringTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*Uint64StringMap) Equals ¶
func (mm *Uint64StringMap) Equals(other *Uint64StringMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*Uint64StringMap) Exists ¶
func (mm *Uint64StringMap) Exists(p func(uint64, string) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*Uint64StringMap) Filter ¶
func (mm *Uint64StringMap) Filter(p func(uint64, string) bool) *Uint64StringMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*Uint64StringMap) Find ¶
func (mm *Uint64StringMap) Find(p func(uint64, string) bool) (Uint64StringTuple, bool)
Find returns the first string that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*Uint64StringMap) FlatMap ¶
func (mm *Uint64StringMap) FlatMap(f func(uint64, string) []Uint64StringTuple) *Uint64StringMap
FlatMap returns a new StringMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64StringMap) Forall ¶
func (mm *Uint64StringMap) Forall(p func(uint64, string) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*Uint64StringMap) Foreach ¶
func (mm *Uint64StringMap) Foreach(f func(uint64, string))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*Uint64StringMap) Get ¶
func (mm *Uint64StringMap) Get(k uint64) (string, bool)
Get returns one of the items in the map, if present.
func (*Uint64StringMap) GobDecode ¶
func (mm *Uint64StringMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register string with the 'gob' package before this method is used.
func (*Uint64StringMap) GobEncode ¶
func (mm *Uint64StringMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register string with the 'gob' package before this method is used.
func (*Uint64StringMap) IsEmpty ¶
func (mm *Uint64StringMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*Uint64StringMap) Keys ¶
func (mm *Uint64StringMap) Keys() collection.Uint64List
Keys returns the keys of the current map as a slice.
func (*Uint64StringMap) Map ¶
func (mm *Uint64StringMap) Map(f func(uint64, string) (uint64, string)) *Uint64StringMap
Map returns a new StringMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64StringMap) MkString ¶
func (mm *Uint64StringMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*Uint64StringMap) MkString4 ¶ added in v0.7.0
func (mm *Uint64StringMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*Uint64StringMap) NonEmpty ¶
func (mm *Uint64StringMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*Uint64StringMap) OrderedSlice ¶
func (mm *Uint64StringMap) OrderedSlice(keys collection.Uint64List) Uint64StringTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*Uint64StringMap) Partition ¶
func (mm *Uint64StringMap) Partition(p func(uint64, string) bool) (matching *Uint64StringMap, others *Uint64StringMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*Uint64StringMap) Pop ¶
func (mm *Uint64StringMap) Pop(k uint64) (string, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*Uint64StringMap) Put ¶
func (mm *Uint64StringMap) Put(k uint64, v string) bool
Put adds an item to the current map, replacing any prior value.
func (*Uint64StringMap) Remove ¶
func (mm *Uint64StringMap) Remove(k uint64)
Remove a single item from the map.
func (*Uint64StringMap) Size ¶
func (mm *Uint64StringMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*Uint64StringMap) String ¶
func (mm *Uint64StringMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*Uint64StringMap) ToSlice ¶
func (mm *Uint64StringMap) ToSlice() Uint64StringTuples
ToSlice returns the key/value pairs as a slice
func (*Uint64StringMap) Values ¶
func (mm *Uint64StringMap) Values() collection.StringList
Values returns the values of the current map as a slice.
type Uint64StringTuple ¶
Uint64StringTuple represents a key/value pair.
func (Uint64StringTuple) MarshalJSON ¶
func (t Uint64StringTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (Uint64StringTuple) UnmarshalJSON ¶
func (t Uint64StringTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type Uint64StringTuples ¶
type Uint64StringTuples []Uint64StringTuple
Uint64StringTuples can be used as a builder for unmodifiable maps.
func Uint64StringZip ¶
func Uint64StringZip(keys ...uint64) Uint64StringTuples
Uint64StringZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewUint64StringMap constructor function.
func (Uint64StringTuples) Append1 ¶
func (ts Uint64StringTuples) Append1(k uint64, v string) Uint64StringTuples
Append1 adds one item.
func (Uint64StringTuples) Append2 ¶
func (ts Uint64StringTuples) Append2(k1 uint64, v1 string, k2 uint64, v2 string) Uint64StringTuples
Append2 adds two items.
func (Uint64StringTuples) Append3 ¶
func (ts Uint64StringTuples) Append3(k1 uint64, v1 string, k2 uint64, v2 string, k3 uint64, v3 string) Uint64StringTuples
Append3 adds three items.
func (Uint64StringTuples) MkString ¶
func (ts Uint64StringTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (Uint64StringTuples) MkString4 ¶ added in v0.7.0
func (ts Uint64StringTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (Uint64StringTuples) String ¶
func (ts Uint64StringTuples) String() string
func (Uint64StringTuples) ToMap ¶
func (ts Uint64StringTuples) ToMap() *Uint64StringMap
ToMap converts the tuples to a map.
func (Uint64StringTuples) Values ¶
func (ts Uint64StringTuples) Values(values ...string) Uint64StringTuples
Values sets the values in a tuple slice. Use this with Uint64StringZip.
type Uint64Uint64Map ¶
type Uint64Uint64Map struct {
// contains filtered or unexported fields
}
Uint64Uint64Map is the primary type that represents a thread-safe map
func NewUint64Uint64Map ¶
func NewUint64Uint64Map(kv ...Uint64Uint64Tuple) *Uint64Uint64Map
NewUint64Uint64Map creates and returns a reference to a map, optionally containing some items.
func NewUint64Uint64Map1 ¶
func NewUint64Uint64Map1(k uint64, v uint64) *Uint64Uint64Map
NewUint64Uint64Map1 creates and returns a reference to a map containing one item.
func (*Uint64Uint64Map) Clone ¶
func (mm *Uint64Uint64Map) Clone() *Uint64Uint64Map
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*Uint64Uint64Map) ContainsAllKeys ¶
func (mm *Uint64Uint64Map) ContainsAllKeys(kk ...uint64) bool
ContainsAllKeys determines if the given items are all in the map.
func (*Uint64Uint64Map) ContainsKey ¶
func (mm *Uint64Uint64Map) ContainsKey(k uint64) bool
ContainsKey determines if a given item is already in the map.
func (*Uint64Uint64Map) DropWhere ¶
func (mm *Uint64Uint64Map) DropWhere(fn func(uint64, uint64) bool) Uint64Uint64Tuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*Uint64Uint64Map) Equals ¶
func (mm *Uint64Uint64Map) Equals(other *Uint64Uint64Map) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*Uint64Uint64Map) Exists ¶
func (mm *Uint64Uint64Map) Exists(p func(uint64, uint64) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*Uint64Uint64Map) Filter ¶
func (mm *Uint64Uint64Map) Filter(p func(uint64, uint64) bool) *Uint64Uint64Map
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*Uint64Uint64Map) Find ¶
func (mm *Uint64Uint64Map) Find(p func(uint64, uint64) bool) (Uint64Uint64Tuple, bool)
Find returns the first uint64 that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*Uint64Uint64Map) FlatMap ¶
func (mm *Uint64Uint64Map) FlatMap(f func(uint64, uint64) []Uint64Uint64Tuple) *Uint64Uint64Map
FlatMap returns a new Uint64Map by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Uint64Map) Forall ¶
func (mm *Uint64Uint64Map) Forall(p func(uint64, uint64) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*Uint64Uint64Map) Foreach ¶
func (mm *Uint64Uint64Map) Foreach(f func(uint64, uint64))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*Uint64Uint64Map) Get ¶
func (mm *Uint64Uint64Map) Get(k uint64) (uint64, bool)
Get returns one of the items in the map, if present.
func (*Uint64Uint64Map) GobDecode ¶
func (mm *Uint64Uint64Map) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register uint64 with the 'gob' package before this method is used.
func (*Uint64Uint64Map) GobEncode ¶
func (mm *Uint64Uint64Map) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register uint64 with the 'gob' package before this method is used.
func (*Uint64Uint64Map) IsEmpty ¶
func (mm *Uint64Uint64Map) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*Uint64Uint64Map) Keys ¶
func (mm *Uint64Uint64Map) Keys() collection.Uint64List
Keys returns the keys of the current map as a slice.
func (*Uint64Uint64Map) Map ¶
func (mm *Uint64Uint64Map) Map(f func(uint64, uint64) (uint64, uint64)) *Uint64Uint64Map
Map returns a new Uint64Map by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*Uint64Uint64Map) MkString ¶
func (mm *Uint64Uint64Map) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*Uint64Uint64Map) MkString4 ¶ added in v0.7.0
func (mm *Uint64Uint64Map) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*Uint64Uint64Map) NonEmpty ¶
func (mm *Uint64Uint64Map) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*Uint64Uint64Map) OrderedSlice ¶
func (mm *Uint64Uint64Map) OrderedSlice(keys collection.Uint64List) Uint64Uint64Tuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*Uint64Uint64Map) Partition ¶
func (mm *Uint64Uint64Map) Partition(p func(uint64, uint64) bool) (matching *Uint64Uint64Map, others *Uint64Uint64Map)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*Uint64Uint64Map) Pop ¶
func (mm *Uint64Uint64Map) Pop(k uint64) (uint64, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*Uint64Uint64Map) Put ¶
func (mm *Uint64Uint64Map) Put(k uint64, v uint64) bool
Put adds an item to the current map, replacing any prior value.
func (*Uint64Uint64Map) Remove ¶
func (mm *Uint64Uint64Map) Remove(k uint64)
Remove a single item from the map.
func (*Uint64Uint64Map) Size ¶
func (mm *Uint64Uint64Map) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*Uint64Uint64Map) String ¶
func (mm *Uint64Uint64Map) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*Uint64Uint64Map) ToSlice ¶
func (mm *Uint64Uint64Map) ToSlice() Uint64Uint64Tuples
ToSlice returns the key/value pairs as a slice
func (*Uint64Uint64Map) Values ¶
func (mm *Uint64Uint64Map) Values() collection.Uint64List
Values returns the values of the current map as a slice.
type Uint64Uint64Tuple ¶
Uint64Uint64Tuple represents a key/value pair.
func (Uint64Uint64Tuple) MarshalJSON ¶
func (t Uint64Uint64Tuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (Uint64Uint64Tuple) UnmarshalJSON ¶
func (t Uint64Uint64Tuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type Uint64Uint64Tuples ¶
type Uint64Uint64Tuples []Uint64Uint64Tuple
Uint64Uint64Tuples can be used as a builder for unmodifiable maps.
func Uint64Uint64Zip ¶
func Uint64Uint64Zip(keys ...uint64) Uint64Uint64Tuples
Uint64Uint64Zip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewUint64Uint64Map constructor function.
func (Uint64Uint64Tuples) Append1 ¶
func (ts Uint64Uint64Tuples) Append1(k uint64, v uint64) Uint64Uint64Tuples
Append1 adds one item.
func (Uint64Uint64Tuples) Append2 ¶
func (ts Uint64Uint64Tuples) Append2(k1 uint64, v1 uint64, k2 uint64, v2 uint64) Uint64Uint64Tuples
Append2 adds two items.
func (Uint64Uint64Tuples) Append3 ¶
func (ts Uint64Uint64Tuples) Append3(k1 uint64, v1 uint64, k2 uint64, v2 uint64, k3 uint64, v3 uint64) Uint64Uint64Tuples
Append3 adds three items.
func (Uint64Uint64Tuples) MkString ¶
func (ts Uint64Uint64Tuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (Uint64Uint64Tuples) MkString4 ¶ added in v0.7.0
func (ts Uint64Uint64Tuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (Uint64Uint64Tuples) String ¶
func (ts Uint64Uint64Tuples) String() string
func (Uint64Uint64Tuples) ToMap ¶
func (ts Uint64Uint64Tuples) ToMap() *Uint64Uint64Map
ToMap converts the tuples to a map.
func (Uint64Uint64Tuples) Values ¶
func (ts Uint64Uint64Tuples) Values(values ...uint64) Uint64Uint64Tuples
Values sets the values in a tuple slice. Use this with Uint64Uint64Zip.
type UintCollection ¶
type UintCollection interface { UintSizer UintMkStringer // IsSequence returns true for lists and queues. IsSequence() bool // IsSet returns false for lists and queues. IsSet() bool // ToSlice returns a shallow copy as a plain slice. ToSlice() []uint // ToInterfaceSlice returns a shallow copy as a slice of arbitrary type. ToInterfaceSlice() []interface{} // Exists verifies that one or more elements of UintCollection return true for the predicate p. Exists(p func(uint) bool) bool // Forall verifies that all elements of UintCollection return true for the predicate p. Forall(p func(uint) bool) bool // Foreach iterates over UintCollection and executes the function f against each element. Foreach(f func(uint)) // Find returns the first uint that returns true for the predicate p. // False is returned if none match. Find(p func(uint) bool) (uint, bool) // MapToString returns a new []string by transforming every element with function f. // The resulting slice is the same size as the collection. The collection is not modified. MapToString(f func(uint) string) []string // FlatMapString returns a new []string by transforming every element with function f // that returns zero or more items in a slice. The resulting slice may have a different size to the // collection. The collection is not modified. FlatMapToString(f func(uint) []string) []string // Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example. // A goroutine is created to send the elements; this only terminates when all the elements have been consumed Send() <-chan uint // CountBy gives the number elements of UintCollection that return true for the predicate p. CountBy(p func(uint) bool) int // Contains determines whether a given item is already in the collection, returning true if so. Contains(v uint) bool // ContainsAll determines whether the given items are all in the collection, returning true if so. ContainsAll(v ...uint) bool // Clear the entire collection. Clear() // Add adds items to the current collection. Add(more ...uint) // Min returns the minimum value of all the items in the collection. Panics if there are no elements. Min() uint // Max returns the minimum value of all the items in the collection. Panics if there are no elements. Max() uint // MinBy returns an element of UintCollection containing the minimum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such // element is returned. Panics if there are no elements. MinBy(less func(uint, uint) bool) uint // MaxBy returns an element of UintCollection containing the maximum value, when compared to other elements // using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such // element is returned. Panics if there are no elements. MaxBy(less func(uint, uint) bool) uint // Fold aggregates all the values in the collection using a supplied function, starting from some initial value. Fold(initial uint, fn func(uint, uint) uint) uint // Sum returns the sum of all the elements in the collection. Sum() uint }
UintCollection defines an interface for common collection methods on uint.
type UintList ¶
type UintList struct {
// contains filtered or unexported fields
}
UintList contains a slice of type uint. It encapsulates the slice and provides methods to access or mutate it.
List values follow a similar pattern to Scala Lists and LinearSeqs in particular. For comparison with Scala, see e.g. http://www.scala-lang.org/api/2.11.7/#scala.collection.LinearSeq
func BuildUintListFromChan ¶
BuildUintListFromChan constructs a new UintList from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertUintList ¶
ConvertUintList constructs a new list containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned list will contain all the values that were correctly converted. Conversions are provided from all built-in numeric types.
func MakeUintList ¶
MakeUintList makes an empty list with both length and capacity initialised.
func NewUintList ¶
NewUintList constructs a new list containing the supplied values, if any.
func (*UintList) Append ¶
Append adds items to the current list. If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned.
func (*UintList) Clone ¶
Clone returns a shallow copy of the list. It does not clone the underlying elements.
func (*UintList) Contains ¶
Contains determines whether a given item is already in the list, returning true if so.
func (*UintList) ContainsAll ¶
ContainsAll determines whether the given items are all in the list, returning true if so. This is potentially a slow method and should only be used rarely.
func (*UintList) CountBy ¶
CountBy gives the number elements of UintList that return true for the predicate p.
func (*UintList) DistinctBy ¶
DistinctBy returns a new UintList whose elements are unique, where equality is defined by the equal function.
func (*UintList) DoDeleteAt ¶
DoDeleteAt modifies a UintList by deleting n elements from a given index.
The list is modified and the modified list is returned. Panics if the index is out of range or n is large enough to take the index out of range.
func (*UintList) DoDeleteFirst ¶
DoDeleteFirst modifies a UintList by deleting n elements from the start of the list.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if n is large enough to take the index out of range.
func (*UintList) DoDeleteLast ¶
DoDeleteLast modifies a UintList by deleting n elements from the end of the list.
The list is modified and the modified list is returned. Panics if n is large enough to take the index out of range.
func (*UintList) DoInsertAt ¶
DoInsertAt modifies a UintList by inserting elements at a given index. This is a generalised version of Append.
If the list is nil, a new list is allocated and returned. Otherwise the modified list is returned. Panics if the index is out of range.
func (*UintList) DoKeepWhere ¶
DoKeepWhere modifies a UintList by retaining only those elements that match the predicate p. This is very similar to Filter but alters the list in place.
The list is modified and the modified list is returned.
func (*UintList) DoReverse ¶
DoReverse alters a UintList with all elements in the reverse order. Unlike Reverse, it does not allocate new memory.
The list is modified and the modified list is returned.
func (*UintList) DoShuffle ¶
DoShuffle returns a shuffled UintList, using a version of the Fisher-Yates shuffle.
The list is modified and the modified list is returned.
func (*UintList) Drop ¶
Drop returns a slice of UintList without the leading n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*UintList) DropLast ¶
DropLast returns a slice of UintList without the trailing n elements of the source list. If n is greater than or equal to the size of the list, an empty list is returned.
The original list is not modified.
func (*UintList) DropWhile ¶
DropWhile returns a new UintList containing the trailing elements of the source list. Whilst the predicate p returns true, elements are excluded from the result. Once predicate p returns false, all remaining elements are added.
The original list is not modified.
func (*UintList) Equals ¶
Equals determines if two lists are equal to each other. If they both are the same size and have the same items in the same order, they are considered equal. Order of items is not relevent for sets to be equal. Nil lists are considered to be empty.
func (*UintList) Exists ¶
Exists verifies that one or more elements of UintList return true for the predicate p.
func (*UintList) Filter ¶
Filter returns a new UintList whose elements return true for predicate p.
The original list is not modified. See also DoKeepWhere (which does modify the original list).
func (*UintList) Find ¶
Find returns the first uint that returns true for predicate p. False is returned if none match.
func (*UintList) FlatMap ¶
FlatMap returns a new UintList by transforming every element with function f that returns zero or more items in a slice. The resulting list may have a different size to the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintList) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintList) Fold ¶ added in v0.9.0
Fold aggregates all the values in the list using a supplied function, starting from some initial value.
func (*UintList) Forall ¶
Forall verifies that all elements of UintList return true for the predicate p.
func (*UintList) Foreach ¶
Foreach iterates over UintList and executes function f against each element. The function can safely alter the values via side-effects.
func (*UintList) Get ¶
Get gets the specified element in the list. Panics if the index is out of range or the list is nil.
func (*UintList) GobDecode ¶
GobDecode implements 'gob' decoding for this list type. You must register uint with the 'gob' package before this method is used.
func (UintList) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register uint with the 'gob' package before this method is used.
func (*UintList) Head ¶
Head gets the first element in the list. Head plus Tail include the whole list. Head is the opposite of Last. Panics if list is empty or nil.
func (*UintList) HeadOption ¶
HeadOption gets the first element in the list, if possible. Otherwise returns the zero value.
func (*UintList) IndexWhere ¶
IndexWhere finds the index of the first element satisfying predicate p. If none exists, -1 is returned.
func (*UintList) IndexWhere2 ¶
IndexWhere2 finds the index of the first element satisfying predicate p at or after some start index. If none exists, -1 is returned.
func (*UintList) Init ¶
Init gets everything except the last. Init plus Last include the whole list. Init is the opposite of Tail. Panics if list is empty or nil.
func (*UintList) IsSequence ¶
IsSequence returns true for lists and queues.
func (*UintList) Last ¶
Last gets the last element in the list. Init plus Last include the whole list. Last is the opposite of Head. Panics if list is empty or nil.
func (*UintList) LastIndexWhere ¶
LastIndexWhere finds the index of the last element satisfying predicate p. If none exists, -1 is returned.
func (*UintList) LastIndexWhere2 ¶
LastIndexWhere2 finds the index of the last element satisfying predicate p at or before some start index. If none exists, -1 is returned.
func (*UintList) LastOption ¶
LastOption gets the last element in the list, if possible. Otherwise returns the zero value.
func (*UintList) Len ¶
Len returns the number of items in the list - an alias of Size(). This is one of the three methods in the standard sort.Interface.
func (*UintList) Map ¶
Map returns a new UintList by transforming every element with function f. The resulting list is the same size as the original list. The original list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintList) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the list. The list is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (UintList) MarshalJSON ¶
MarshalJSON implements JSON encoding for this list type.
func (*UintList) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*UintList) MaxBy ¶
MaxBy returns an element of UintList containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*UintList) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*UintList) MinBy ¶
MinBy returns an element of UintList containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*UintList) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*UintList) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*UintList) Partition ¶
Partition returns two new UintLists whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original list is not modified
func (*UintList) Reverse ¶
Reverse returns a copy of UintList with all elements in the reverse order.
The original list is not modified.
func (*UintList) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*UintList) Shuffle ¶
Shuffle returns a shuffled copy of UintList, using a version of the Fisher-Yates shuffle.
The original list is not modified.
func (*UintList) SortBy ¶
SortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned.
func (*UintList) Sorted ¶
Sorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*UintList) StableSortBy ¶
StableSortBy alters the list so that the elements are sorted by a specified ordering. Sorting happens in-place; the modified list is returned. The algorithm keeps the original order of equal elements.
func (*UintList) StableSorted ¶
StableSorted alters the list so that the elements are sorted by their natural ordering. Sorting happens in-place; the modified list is returned.
func (*UintList) String ¶
String implements the Stringer interface to render the list as a comma-separated string enclosed in square brackets.
func (*UintList) StringList ¶
StringList gets a list of strings that depicts all the elements.
func (*UintList) Swap ¶
Swap exchanges two elements, which is necessary during sorting etc. This is one of the three methods in the standard sort.Interface.
func (*UintList) Tail ¶
Tail gets everything except the head. Head plus Tail include the whole list. Tail is the opposite of Init. Panics if list is empty or nil.
func (*UintList) Take ¶
Take returns a slice of UintList containing the leading n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
func (*UintList) TakeLast ¶
TakeLast returns a slice of UintList containing the trailing n elements of the source list. If n is greater than or equal to the size of the list, the whole original list is returned.
The original list is not modified.
func (*UintList) TakeWhile ¶
TakeWhile returns a new UintList containing the leading elements of the source list. Whilst the predicate p returns true, elements are added to the result. Once predicate p returns false, all remaining elements are excluded.
The original list is not modified.
func (*UintList) ToInterfaceSlice ¶
func (list *UintList) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current list as a slice of arbitrary type.
func (*UintList) ToList ¶
ToList returns the elements of the list as a list, which is an identity operation in this case.
func (*UintList) ToSet ¶
ToSet returns the elements of the list as a set. The returned set is a shallow copy; the list is not altered.
func (*UintList) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this list type.
type UintMkStringer ¶
type UintMkStringer interface { // String implements the Stringer interface to render the collection as a comma-separated string enclosed // in square brackets. String() string // MkString concatenates the values as a string using a supplied separator. No enclosing marks are added. MkString(sep string) string // MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied. MkString3(before, between, after string) string // implements json.Marshaler interface { MarshalJSON() ([]byte, error) // implements json.Unmarshaler interface { UnmarshalJSON(b []byte) error // StringList gets a collection of strings that depicts all the elements. StringList() []string }
UintMkStringer defines an interface for stringer methods on uint collections.
type UintQueue ¶ added in v0.8.0
type UintQueue struct {
// contains filtered or unexported fields
}
UintQueue is a ring buffer containing a slice of type uint. It is optimised for FIFO operations.
func BuildUintQueueFromChan ¶ added in v0.8.0
BuildUintQueueFromChan constructs a new UintQueue from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func NewUintQueue ¶ added in v0.8.0
NewUintQueue returns a new queue of uint. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue.
func NewUintSortedQueue ¶ added in v0.8.0
NewUintSortedQueue returns a new queue of uint. The behaviour when adding to the queue depends on overwrite. If true, the push operation overwrites oldest values up to the space available, when the queue is full. Otherwise, it refuses to overfill the queue. If the 'less' comparison function is not nil, elements can be easily sorted.
func (*UintQueue) Clone ¶ added in v0.8.0
Clone returns a shallow copy of the queue. It does not clone the underlying elements.
func (*UintQueue) Contains ¶ added in v0.8.0
Contains determines whether a given item is already in the queue, returning true if so.
func (*UintQueue) ContainsAll ¶ added in v0.8.0
ContainsAll determines whether the given items are all in the queue, returning true if so. This is potentially a slow method and should only be used rarely.
func (*UintQueue) CountBy ¶ added in v0.8.0
CountBy gives the number elements of UintQueue that return true for the predicate p.
func (*UintQueue) DoKeepWhere ¶ added in v0.8.0
DoKeepWhere modifies a UintQueue by retaining only those elements that match the predicate p. This is very similar to Filter but alters the queue in place.
The queue is modified and the modified queue is returned.
func (*UintQueue) Equals ¶ added in v0.8.0
Equals determines if two queues are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal. Nil queues are considered to be empty.
func (*UintQueue) Exists ¶ added in v0.8.0
Exists verifies that one or more elements of UintQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*UintQueue) Filter ¶ added in v0.8.0
Filter returns a new UintQueue whose elements return true for predicate p.
The original queue is not modified. See also DoKeepWhere (which does modify the original queue).
func (*UintQueue) Find ¶ added in v0.8.0
Find returns the first uint that returns true for predicate p. False is returned if none match.
func (*UintQueue) FlatMap ¶ added in v0.8.0
FlatMap returns a new UintQueue by transforming every element with function f that returns zero or more items in a slice. The resulting queue may have a different size to the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintQueue) FlatMapToString ¶ added in v0.8.0
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintQueue) Fold ¶ added in v0.9.0
Fold aggregates all the values in the queue using a supplied function, starting from some initial value.
func (*UintQueue) Forall ¶ added in v0.8.0
Forall verifies that all elements of UintQueue return true for the predicate p. The function should not alter the values via side-effects.
func (*UintQueue) Foreach ¶ added in v0.8.0
Foreach iterates over UintQueue and executes function f against each element. The function can safely alter the values via side-effects.
func (*UintQueue) Get ¶ added in v0.8.0
Get gets the specified element in the queue. Panics if the index is out of range or the queue is nil.
func (*UintQueue) Head ¶ added in v0.8.0
Head gets the first element in the queue. Head is the opposite of Last. Panics if queue is empty or nil.
func (*UintQueue) HeadOption ¶ added in v0.8.0
HeadOption returns the oldest item in the queue without removing it. If the queue is nil or empty, it returns the zero value instead.
func (*UintQueue) IsOverwriting ¶ added in v0.8.0
IsOverwriting returns true if the queue is overwriting, false if refusing.
func (*UintQueue) IsSequence ¶ added in v0.8.0
IsSequence returns true for ordered lists and queues.
func (*UintQueue) Last ¶ added in v0.8.0
Last gets the the newest item in the queue (i.e. last element pushed) without removing it. Last is the opposite of Head. Panics if queue is empty or nil.
func (*UintQueue) LastOption ¶ added in v0.8.0
LastOption returns the newest item in the queue without removing it. If the queue is nil empty, it returns the zero value instead.
func (*UintQueue) Len ¶ added in v0.8.0
Len gets the current length of this queue. This is an alias for Size.
func (*UintQueue) Less ¶ added in v0.8.0
Less reports whether the element with index i should sort before the element with index j. The queue must have been created with a non-nil 'less' comparison function and it must not be empty.
func (*UintQueue) Map ¶ added in v0.8.0
Map returns a new UintQueue by transforming every element with function f. The resulting queue is the same size as the original queue. The original queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintQueue) MapToString ¶ added in v0.8.0
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the queue. The queue is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (UintQueue) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements JSON encoding for this queue type.
func (*UintQueue) Max ¶ added in v0.8.0
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*UintQueue) MaxBy ¶ added in v0.8.0
MaxBy returns an element of UintQueue containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*UintQueue) Min ¶ added in v0.8.0
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*UintQueue) MinBy ¶ added in v0.8.0
MinBy returns an element of UintQueue containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*UintQueue) MkString ¶ added in v0.8.0
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*UintQueue) MkString3 ¶ added in v0.8.0
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*UintQueue) Offer ¶ added in v0.8.0
Offer appends as many items to the end of the queue as it can. If the queue is already full, what happens depends on whether the queue is configured to overwrite. If it is, the oldest items will be overwritten. Otherwise, it will be filled to capacity and any unwritten items are returned.
If the capacity is too small for the number of items, the excess items are returned. The queue capacity is never altered.
func (*UintQueue) Partition ¶ added in v0.8.0
Partition returns two new UintQueues whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original queue.
The original queue is not modified
func (*UintQueue) Pop ¶ added in v0.8.0
Pop removes and returns the oldest items from the queue. If the queue is empty, it returns a nil slice. If n is larger than the current queue length, it returns all the available elements, so in this case the returned slice will be shorter than n.
func (*UintQueue) Pop1 ¶ added in v0.8.0
Pop1 removes and returns the oldest item from the queue. If the queue is empty, it returns the zero value instead. The boolean is true only if the element was available.
func (*UintQueue) Push ¶ added in v0.8.0
Push appends items to the end of the queue. If the queue does not have enough space, more will be allocated: how this happens depends on the overwriting mode.
When overwriting, the oldest items are overwritten with the new data; it expands the queue only if there is still not enough space.
Otherwise, the queue might be reallocated if necessary, ensuring that all the data is pushed without any older items being affected.
The modified queue is returned.
func (*UintQueue) Reallocate ¶ added in v0.8.0
Reallocate adjusts the allocated capacity of the queue and allows the overwriting behaviour to be changed.
If the new queue capacity is different to the current capacity, the queue is re-allocated to the new capacity. If this is less than the current number of elements, the oldest items in the queue are discarded so that the remaining data can fit in the new space available.
If the new queue capacity is the same as the current capacity, the queue is not altered except for adopting the new overwrite flag's value. Therefore this is the means to change the overwriting behaviour.
Reallocate adjusts the storage space but does not clone the underlying elements.
The queue must not be nil.
func (*UintQueue) Send ¶ added in v0.8.0
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed. The channel will be closed when all the elements have been sent.
func (*UintQueue) Size ¶ added in v0.8.0
Size gets the number of elements currently in this queue. This is an alias for Len.
func (*UintQueue) Sort ¶ added in v0.8.0
func (queue *UintQueue) Sort()
Sort sorts the queue using the 'less' comparison function, which must not be nil. This function will panic if the collection was created with a nil 'less' function (see NewUintSortedQueue).
func (*UintQueue) StableSort ¶ added in v0.8.0
func (queue *UintQueue) StableSort()
StableSort sorts the queue using the 'less' comparison function, which must not be nil. The result is stable so that repeated calls will not arbitrarily swap equal items. This function will panic if the collection was created with a nil 'less' function (see NewUintSortedQueue).
func (*UintQueue) String ¶ added in v0.8.0
String implements the Stringer interface to render the queue as a comma-separated string enclosed in square brackets.
func (*UintQueue) StringList ¶ added in v0.8.0
StringList gets a list of strings that depicts all the elements.
func (*UintQueue) Swap ¶ added in v0.8.0
Swap swaps the elements with indexes i and j. The queue must not be empty.
func (*UintQueue) ToInterfaceSlice ¶ added in v0.8.0
func (queue *UintQueue) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the queue as a slice of arbitrary type. The queue is not altered.
func (*UintQueue) ToList ¶ added in v0.9.0
ToList returns the elements of the queue as a list. The returned list is a shallow copy; the queue is not altered.
func (*UintQueue) ToSet ¶ added in v0.8.0
ToSet returns the elements of the queue as a set. The returned set is a shallow copy; the queue is not altered.
func (*UintQueue) ToSlice ¶ added in v0.8.0
ToSlice returns the elements of the queue as a slice. The queue is not altered.
func (*UintQueue) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements JSON decoding for this queue type.
type UintSequence ¶ added in v0.9.0
type UintSequence interface { UintCollection // Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last. Head() uint // HeadOption gets the first element in the sequence, if possible. HeadOption() (uint, bool) // Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head. Last() uint // LastOption gets the last element in the sequence, if possible. LastOption() (uint, bool) }
UintSequence defines an interface for sequence methods on uint.
type UintSet ¶
type UintSet struct {
// contains filtered or unexported fields
}
UintSet is the primary type that represents a set.
func BuildUintSetFromChan ¶
BuildUintSetFromChan constructs a new UintSet from a channel that supplies a sequence of values until it is closed. The function doesn't return until then.
func ConvertUintSet ¶
ConvertUintSet constructs a new set containing the supplied values, if any. The returned boolean will be false if any of the values could not be converted correctly. The returned set will contain all the values that were correctly converted.
func NewUintSet ¶
NewUintSet creates and returns a reference to an empty set.
func (*UintSet) Cardinality ¶
Cardinality returns how many items are currently in the set. This is a synonym for Size.
func (*UintSet) Clear ¶
func (set *UintSet) Clear()
Clear the entire set. Aterwards, it will be an empty set.
func (*UintSet) Clone ¶
Clone returns a shallow copy of the set. It does not clone the underlying elements.
func (*UintSet) Contains ¶
Contains determines whether a given item is already in the set, returning true if so.
func (*UintSet) ContainsAll ¶
ContainsAll determines whether the given items are all in the set, returning true if so.
func (*UintSet) CountBy ¶
CountBy gives the number elements of UintSet that return true for the predicate p.
func (*UintSet) Difference ¶
Difference returns a new set with items in the current set but not in the other set
func (*UintSet) Equals ¶
Equals determines whether two sets are equal to each other, returning true if so. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (*UintSet) Exists ¶
Exists applies a predicate p to every element in the set. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*UintSet) Filter ¶
Filter returns a new UintSet whose elements return true for the predicate p.
The original set is not modified
func (*UintSet) Find ¶
Find returns the first uint that returns true for the predicate p. If there are many matches one is arbtrarily chosen. False is returned if none match.
func (*UintSet) FlatMap ¶
FlatMap returns a new UintSet by transforming every element with a function f that returns zero or more items in a slice. The resulting set may have a different size to the original set. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintSet) FlatMapToString ¶
FlatMapToString returns a new []string by transforming every element with function f that returns zero or more items in a slice. The resulting slice may have a different size to the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintSet) Fold ¶ added in v0.9.0
Fold aggregates all the values in the set using a supplied function, starting from some initial value.
func (*UintSet) Forall ¶
Forall applies a predicate function p to every element in the set. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*UintSet) Foreach ¶
Foreach iterates over the set and executes the function f against each element. The function can safely alter the values via side-effects.
func (*UintSet) GobDecode ¶
GobDecode implements 'gob' decoding for this set type. You must register uint with the 'gob' package before this method is used.
func (UintSet) GobEncode ¶
GobEncode implements 'gob' encoding for this list type. You must register uint with the 'gob' package before this method is used.
func (*UintSet) IsSequence ¶
IsSequence returns true for lists and queues.
func (*UintSet) IsSubset ¶
IsSubset determines whether every item in the other set is in this set, returning true if so.
func (*UintSet) IsSuperset ¶
IsSuperset determines whether every item of this set is in the other set, returning true if so.
func (*UintSet) Map ¶
Map returns a new UintSet by transforming every element with a function f. The original set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintSet) MapToString ¶
MapToString returns a new []string by transforming every element with function f. The resulting slice is the same size as the set. The set is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintSet) MarshalJSON ¶
MarshalJSON implements JSON encoding for this set type.
func (*UintSet) Max ¶
Max returns the first element containing the maximum value, when compared to other elements. Panics if the collection is empty.
func (*UintSet) MaxBy ¶
MaxBy returns an element of UintSet containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such element is returned. Panics if there are no elements.
func (*UintSet) Min ¶
Min returns the first element containing the minimum value, when compared to other elements. Panics if the collection is empty.
func (*UintSet) MinBy ¶
MinBy returns an element of UintSet containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Panics if there are no elements.
func (*UintSet) MkString ¶
MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
func (*UintSet) MkString3 ¶
MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
func (*UintSet) Partition ¶
Partition returns two new UintSets whose elements return true or false for the predicate, p. The first result consists of all elements that satisfy the predicate and the second result consists of all elements that don't. The relative order of the elements in the results is the same as in the original list.
The original set is not modified
func (*UintSet) Send ¶
Send returns a channel that will send all the elements in order. A goroutine is created to send the elements; this only terminates when all the elements have been consumed
func (*UintSet) Size ¶
Size returns how many items are currently in the set. This is a synonym for Cardinality.
func (*UintSet) String ¶
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*UintSet) StringList ¶
StringSet gets a list of strings that depicts all the elements.
func (*UintSet) StringMap ¶
StringMap renders the set as a map of strings. The value of each item in the set becomes stringified as a key in the resulting map.
func (*UintSet) SymmetricDifference ¶
SymmetricDifference returns a new set with items in the current set or the other set but not in both.
func (*UintSet) ToInterfaceSlice ¶
func (set *UintSet) ToInterfaceSlice() []interface{}
ToInterfaceSlice returns the elements of the current set as a slice of arbitrary type.
func (*UintSet) ToList ¶
ToList returns the elements of the set as a list. The returned list is a shallow copy; the set is not altered.
func (*UintSet) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding for this set type.
type UintSizer ¶
type UintSizer interface { // IsEmpty tests whether UintCollection is empty. IsEmpty() bool // NonEmpty tests whether UintCollection is empty. NonEmpty() bool // Size returns the number of items in the collection - an alias of Len(). Size() int }
UintSizer defines an interface for sizing methods on uint collections.
type UintStringMap ¶
type UintStringMap struct {
// contains filtered or unexported fields
}
UintStringMap is the primary type that represents a thread-safe map
func NewUintStringMap ¶
func NewUintStringMap(kv ...UintStringTuple) *UintStringMap
NewUintStringMap creates and returns a reference to a map, optionally containing some items.
func NewUintStringMap1 ¶
func NewUintStringMap1(k uint, v string) *UintStringMap
NewUintStringMap1 creates and returns a reference to a map containing one item.
func (*UintStringMap) Clone ¶
func (mm *UintStringMap) Clone() *UintStringMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*UintStringMap) ContainsAllKeys ¶
func (mm *UintStringMap) ContainsAllKeys(kk ...uint) bool
ContainsAllKeys determines if the given items are all in the map.
func (*UintStringMap) ContainsKey ¶
func (mm *UintStringMap) ContainsKey(k uint) bool
ContainsKey determines if a given item is already in the map.
func (*UintStringMap) DropWhere ¶
func (mm *UintStringMap) DropWhere(fn func(uint, string) bool) UintStringTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*UintStringMap) Equals ¶
func (mm *UintStringMap) Equals(other *UintStringMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*UintStringMap) Exists ¶
func (mm *UintStringMap) Exists(p func(uint, string) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*UintStringMap) Filter ¶
func (mm *UintStringMap) Filter(p func(uint, string) bool) *UintStringMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*UintStringMap) Find ¶
func (mm *UintStringMap) Find(p func(uint, string) bool) (UintStringTuple, bool)
Find returns the first string that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*UintStringMap) FlatMap ¶
func (mm *UintStringMap) FlatMap(f func(uint, string) []UintStringTuple) *UintStringMap
FlatMap returns a new StringMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintStringMap) Forall ¶
func (mm *UintStringMap) Forall(p func(uint, string) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*UintStringMap) Foreach ¶
func (mm *UintStringMap) Foreach(f func(uint, string))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*UintStringMap) Get ¶
func (mm *UintStringMap) Get(k uint) (string, bool)
Get returns one of the items in the map, if present.
func (*UintStringMap) GobDecode ¶
func (mm *UintStringMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register string with the 'gob' package before this method is used.
func (*UintStringMap) GobEncode ¶
func (mm *UintStringMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register string with the 'gob' package before this method is used.
func (*UintStringMap) IsEmpty ¶
func (mm *UintStringMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*UintStringMap) Keys ¶
func (mm *UintStringMap) Keys() collection.UintList
Keys returns the keys of the current map as a slice.
func (*UintStringMap) Map ¶
func (mm *UintStringMap) Map(f func(uint, string) (uint, string)) *UintStringMap
Map returns a new StringMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintStringMap) MkString ¶
func (mm *UintStringMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*UintStringMap) MkString4 ¶ added in v0.7.0
func (mm *UintStringMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*UintStringMap) NonEmpty ¶
func (mm *UintStringMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*UintStringMap) OrderedSlice ¶
func (mm *UintStringMap) OrderedSlice(keys collection.UintList) UintStringTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*UintStringMap) Partition ¶
func (mm *UintStringMap) Partition(p func(uint, string) bool) (matching *UintStringMap, others *UintStringMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*UintStringMap) Pop ¶
func (mm *UintStringMap) Pop(k uint) (string, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*UintStringMap) Put ¶
func (mm *UintStringMap) Put(k uint, v string) bool
Put adds an item to the current map, replacing any prior value.
func (*UintStringMap) Remove ¶
func (mm *UintStringMap) Remove(k uint)
Remove a single item from the map.
func (*UintStringMap) Size ¶
func (mm *UintStringMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*UintStringMap) String ¶
func (mm *UintStringMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*UintStringMap) ToSlice ¶
func (mm *UintStringMap) ToSlice() UintStringTuples
ToSlice returns the key/value pairs as a slice
func (*UintStringMap) Values ¶
func (mm *UintStringMap) Values() collection.StringList
Values returns the values of the current map as a slice.
type UintStringTuple ¶
UintStringTuple represents a key/value pair.
func (UintStringTuple) MarshalJSON ¶
func (t UintStringTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (UintStringTuple) UnmarshalJSON ¶
func (t UintStringTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type UintStringTuples ¶
type UintStringTuples []UintStringTuple
UintStringTuples can be used as a builder for unmodifiable maps.
func UintStringZip ¶
func UintStringZip(keys ...uint) UintStringTuples
UintStringZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewUintStringMap constructor function.
func (UintStringTuples) Append1 ¶
func (ts UintStringTuples) Append1(k uint, v string) UintStringTuples
Append1 adds one item.
func (UintStringTuples) Append2 ¶
func (ts UintStringTuples) Append2(k1 uint, v1 string, k2 uint, v2 string) UintStringTuples
Append2 adds two items.
func (UintStringTuples) Append3 ¶
func (ts UintStringTuples) Append3(k1 uint, v1 string, k2 uint, v2 string, k3 uint, v3 string) UintStringTuples
Append3 adds three items.
func (UintStringTuples) MkString ¶
func (ts UintStringTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (UintStringTuples) MkString4 ¶ added in v0.7.0
func (ts UintStringTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (UintStringTuples) String ¶
func (ts UintStringTuples) String() string
func (UintStringTuples) ToMap ¶
func (ts UintStringTuples) ToMap() *UintStringMap
ToMap converts the tuples to a map.
func (UintStringTuples) Values ¶
func (ts UintStringTuples) Values(values ...string) UintStringTuples
Values sets the values in a tuple slice. Use this with UintStringZip.
type UintUintMap ¶
type UintUintMap struct {
// contains filtered or unexported fields
}
UintUintMap is the primary type that represents a thread-safe map
func NewUintUintMap ¶
func NewUintUintMap(kv ...UintUintTuple) *UintUintMap
NewUintUintMap creates and returns a reference to a map, optionally containing some items.
func NewUintUintMap1 ¶
func NewUintUintMap1(k uint, v uint) *UintUintMap
NewUintUintMap1 creates and returns a reference to a map containing one item.
func (*UintUintMap) Clone ¶
func (mm *UintUintMap) Clone() *UintUintMap
Clone returns a shallow copy of the map. It does not clone the underlying elements.
func (*UintUintMap) ContainsAllKeys ¶
func (mm *UintUintMap) ContainsAllKeys(kk ...uint) bool
ContainsAllKeys determines if the given items are all in the map.
func (*UintUintMap) ContainsKey ¶
func (mm *UintUintMap) ContainsKey(k uint) bool
ContainsKey determines if a given item is already in the map.
func (*UintUintMap) DropWhere ¶
func (mm *UintUintMap) DropWhere(fn func(uint, uint) bool) UintUintTuples
DropWhere applies a predicate function to every element in the map. If the function returns true, the element is dropped from the map. This is similar to Filter except that the map is modified.
func (*UintUintMap) Equals ¶
func (mm *UintUintMap) Equals(other *UintUintMap) bool
Equals determines if two maps are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for maps to be equal.
func (*UintUintMap) Exists ¶
func (mm *UintUintMap) Exists(p func(uint, uint) bool) bool
Exists applies the predicate p to every element in the map. If the function returns true, the iteration terminates early. The returned value is true if an early return occurred. or false if all elements were visited without finding a match.
func (*UintUintMap) Filter ¶
func (mm *UintUintMap) Filter(p func(uint, uint) bool) *UintUintMap
Filter applies the predicate p to every element in the map and returns a copied map containing only the elements for which the predicate returned true. The original map is not modified.
func (*UintUintMap) Find ¶
func (mm *UintUintMap) Find(p func(uint, uint) bool) (UintUintTuple, bool)
Find returns the first uint that returns true for the predicate p. False is returned if none match. The original map is not modified.
func (*UintUintMap) FlatMap ¶
func (mm *UintUintMap) FlatMap(f func(uint, uint) []UintUintTuple) *UintUintMap
FlatMap returns a new UintMap by transforming every element with the function f that returns zero or more items in a slice. The resulting map may have a different size to the original map. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintUintMap) Forall ¶
func (mm *UintUintMap) Forall(p func(uint, uint) bool) bool
Forall applies the predicate p to every element in the map. If the function returns false, the iteration terminates early. The returned value is true if all elements were visited, or false if an early return occurred.
Note that this method can also be used simply as a way to visit every element using a function with some side-effects; such a function must always return true.
func (*UintUintMap) Foreach ¶
func (mm *UintUintMap) Foreach(f func(uint, uint))
Foreach applies the function f to every element in the map. The function can safely alter the values via side-effects.
func (*UintUintMap) Get ¶
func (mm *UintUintMap) Get(k uint) (uint, bool)
Get returns one of the items in the map, if present.
func (*UintUintMap) GobDecode ¶
func (mm *UintUintMap) GobDecode(b []byte) error
GobDecode implements 'gob' decoding for this map type. You must register uint with the 'gob' package before this method is used.
func (*UintUintMap) GobEncode ¶
func (mm *UintUintMap) GobEncode() ([]byte, error)
GobEncode implements 'gob' encoding for this map type. You must register uint with the 'gob' package before this method is used.
func (*UintUintMap) IsEmpty ¶
func (mm *UintUintMap) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*UintUintMap) Keys ¶
func (mm *UintUintMap) Keys() collection.UintList
Keys returns the keys of the current map as a slice.
func (*UintUintMap) Map ¶
func (mm *UintUintMap) Map(f func(uint, uint) (uint, uint)) *UintUintMap
Map returns a new UintMap by transforming every element with the function f. The original map is not modified.
This is a domain-to-range mapping function. For bespoke transformations to other types, copy and modify this method appropriately.
func (*UintUintMap) MkString ¶
func (mm *UintUintMap) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (*UintUintMap) MkString4 ¶ added in v0.7.0
func (mm *UintUintMap) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (*UintUintMap) NonEmpty ¶
func (mm *UintUintMap) NonEmpty() bool
NonEmpty returns true if the map is not empty.
func (*UintUintMap) OrderedSlice ¶
func (mm *UintUintMap) OrderedSlice(keys collection.UintList) UintUintTuples
OrderedSlice returns the key/value pairs as a slice in the order specified by keys.
func (*UintUintMap) Partition ¶
func (mm *UintUintMap) Partition(p func(uint, uint) bool) (matching *UintUintMap, others *UintUintMap)
Partition applies the predicate p to every element in the map. It divides the map into two copied maps, the first containing all the elements for which the predicate returned true, and the second containing all the others. The original map is not modified.
func (*UintUintMap) Pop ¶
func (mm *UintUintMap) Pop(k uint) (uint, bool)
Pop removes a single item from the map, returning the value present prior to removal. The boolean result is true only if the key had been present.
func (*UintUintMap) Put ¶
func (mm *UintUintMap) Put(k uint, v uint) bool
Put adds an item to the current map, replacing any prior value.
func (*UintUintMap) Remove ¶
func (mm *UintUintMap) Remove(k uint)
Remove a single item from the map.
func (*UintUintMap) Size ¶
func (mm *UintUintMap) Size() int
Size returns how many items are currently in the map. This is a synonym for Len.
func (*UintUintMap) String ¶
func (mm *UintUintMap) String() string
String implements the Stringer interface to render the set as a comma-separated string enclosed in square brackets.
func (*UintUintMap) ToSlice ¶
func (mm *UintUintMap) ToSlice() UintUintTuples
ToSlice returns the key/value pairs as a slice
func (*UintUintMap) Values ¶
func (mm *UintUintMap) Values() collection.UintList
Values returns the values of the current map as a slice.
type UintUintTuple ¶
UintUintTuple represents a key/value pair.
func (UintUintTuple) MarshalJSON ¶
func (t UintUintTuple) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding.Marshaler interface.
func (UintUintTuple) UnmarshalJSON ¶
func (t UintUintTuple) UnmarshalJSON(b []byte) error
UnmarshalJSON implements JSON decoding for this tuple type.
type UintUintTuples ¶
type UintUintTuples []UintUintTuple
UintUintTuples can be used as a builder for unmodifiable maps.
func UintUintZip ¶
func UintUintZip(keys ...uint) UintUintTuples
UintUintZip is used with the Values method to zip (i.e. interleave) a slice of keys with a slice of values. These can then be passed in to the NewUintUintMap constructor function.
func (UintUintTuples) Append1 ¶
func (ts UintUintTuples) Append1(k uint, v uint) UintUintTuples
Append1 adds one item.
func (UintUintTuples) Append2 ¶
func (ts UintUintTuples) Append2(k1 uint, v1 uint, k2 uint, v2 uint) UintUintTuples
Append2 adds two items.
func (UintUintTuples) Append3 ¶
func (ts UintUintTuples) Append3(k1 uint, v1 uint, k2 uint, v2 uint, k3 uint, v3 uint) UintUintTuples
Append3 adds three items.
func (UintUintTuples) MkString ¶
func (ts UintUintTuples) MkString(sep string) string
MkString concatenates the map key/values as a string using a supplied separator. No enclosing marks are added.
func (UintUintTuples) MkString4 ¶ added in v0.7.0
func (ts UintUintTuples) MkString4(before, between, after, equals string) string
MkString4 concatenates the map key/values as a string, using the prefix, separator and suffix supplied.
func (UintUintTuples) String ¶
func (ts UintUintTuples) String() string
func (UintUintTuples) ToMap ¶
func (ts UintUintTuples) ToMap() *UintUintMap
ToMap converts the tuples to a map.
func (UintUintTuples) Values ¶
func (ts UintUintTuples) Values(values ...uint) UintUintTuples
Values sets the values in a tuple slice. Use this with UintUintZip.
Source Files ¶
- any_collection.go
- any_list.go
- any_queue.go
- any_set.go
- assertions.go
- doc.go
- int64_collection.go
- int64_int64_map.go
- int64_list.go
- int64_queue.go
- int64_set.go
- int64_string_map.go
- int_collection.go
- int_int_map.go
- int_list.go
- int_queue.go
- int_set.go
- int_string_map.go
- string_any_map.go
- string_collection.go
- string_extras.go
- string_int_map.go
- string_list.go
- string_queue.go
- string_set.go
- string_string_map.go
- string_uint_map.go
- uint64_collection.go
- uint64_list.go
- uint64_queue.go
- uint64_set.go
- uint64_string_map.go
- uint64_uint64_map.go
- uint_collection.go
- uint_list.go
- uint_queue.go
- uint_set.go
- uint_string_map.go
- uint_uint_map.go