Documentation
¶
Index ¶
- Constants
- func CreateIntListData(arraySize int, seed *int64) (headItems, tailItems, headItemsReverse, tailItemsReverse []int)
- func CreateMinMaxTestData(arraySize int, seed *int64) (data []int, min int, max int)
- func CreateRandInt(seed *int64) int
- func CreateSerialIntListData(arraySize int, seed *int64) (headItems []int)
- func CreateSerialMinMaxTestData(arraySize int, seed *int64) (data []int, min int, max int)
- func CreateSerialSmallIntListData(arraySize int, seed *int64) (headItems, tailItems, headItemsReverse, tailItemsReverse []int)
- func CreateSingleIntListData(arraySize int, seed *int64) []int
- func CreateSmallIntListData(arraySize int, seed *int64) (headItems, tailItems, headItemsReverse, tailItemsReverse []int)
- func CreateTimeListData(arraySize int, seed *int64) []time.Time
- func DeepCopy[T any](value T, f functions.DeepCopyFunc[T]) T
- func DeepCopySlice[T any](dest, src []T, f functions.DeepCopyFunc[T])
- func DefaultDeepCopy[T any](value T) T
- func DefaultPredicate[T any](T) bool
- func GetDefaultComparer[T any]() functions.ComparerFunc[T]
- func GetLock[T any](c collections.Collection[T]) *sync.RWMutex
- func GetTestMinMax(data []int) (int, int)
- func GetVersion[T any](c collections.Collection[T]) int
- func Gosort[T any](values []T, length int, compare functions.ComparerFunc[T])
- func GosortDescending[T any](values []T, length int, compare functions.ComparerFunc[T])
- func Iif[T any](pred bool, trueVal T, falseVal T) T
- func IndexOf[T any](slc []T, value T, compare functions.ComparerFunc[T], concurrent bool) (index int)
- func LastIndexOf[T any](slc []T, value T, compare functions.ComparerFunc[T], concurrent bool) (index int)
- func Max[T any](slc []T, compare functions.ComparerFunc[T], concurrent bool) T
- func Min[T any](slc []T, compare functions.ComparerFunc[T], concurrent bool) T
- func PartialCopy[T any](source []T, sourceIndex int, dest []T, destIndex int, length int)
- func PartialCopyDeep[T any](source []T, sourceIndex int, dest []T, destIndex int, length int, ...)
- func Reverse[T any](slc []T) []T
- func ReverseSubset[T any](slc []T, start, length int) []T
- type ElementType
- type IteratorBase
- type SortFunc
Constants ¶
const DefaultCapacity = 16
Default capacity for collections (where capacity matters).
Variables ¶
This section is empty.
Functions ¶
func CreateIntListData ¶
func CreateMinMaxTestData ¶
func CreateRandInt ¶
func CreateSerialIntListData ¶
func CreateSingleIntListData ¶
func CreateSmallIntListData ¶
func DeepCopy ¶
func DeepCopy[T any](value T, f functions.DeepCopyFunc[T]) T
func DeepCopySlice ¶
func DeepCopySlice[T any](dest, src []T, f functions.DeepCopyFunc[T])
func DefaultDeepCopy ¶
func DefaultDeepCopy[T any](value T) T
func DefaultPredicate ¶
Default predicate function for anywhere a predicate is required but all elements should be included.
func GetDefaultComparer ¶
func GetDefaultComparer[T any]() functions.ComparerFunc[T]
GetDefaultComparer returns a function to compare two values of types supported by this module.
Return value semantics are that if first value less than second value, the result is a negative integer. If they are equal, the result is zero, else a positive integer. Magniitude of the result is unimportant. This permits a faster compare for signed int values by use of simple subtraction.
func GetLock ¶
func GetLock[T any](c collections.Collection[T]) *sync.RWMutex
func GetTestMinMax ¶
func GetVersion ¶
func GetVersion[T any](c collections.Collection[T]) int
func Gosort ¶
func Gosort[T any](values []T, length int, compare functions.ComparerFunc[T])
Gosort sorts values (in-place) with respect to the given ComparerFunc using Go's built in sort.
func GosortDescending ¶
func GosortDescending[T any](values []T, length int, compare functions.ComparerFunc[T])
GosortDescending sorts values (in-place) in descending order with respect to the given ComparerFunc using Go's built in sort.
func IndexOf ¶
func IndexOf[T any](slc []T, value T, compare functions.ComparerFunc[T], concurrent bool) (index int)
Get index in slice of given value. Return -1 if no match.
func LastIndexOf ¶
func LastIndexOf[T any](slc []T, value T, compare functions.ComparerFunc[T], concurrent bool) (index int)
Get last index in slice of given value. Return -1 if no match.
func PartialCopy ¶
As per .NET Array.Copy(Array, Int32, Array, Int32, Int32).
func PartialCopyDeep ¶
func PartialCopyDeep[T any](source []T, sourceIndex int, dest []T, destIndex int, length int, f functions.DeepCopyFunc[T])
As per .NET Array.Copy(Array, Int32, Array, Int32, Int32) but call provided DeepCopy function on every element.
func Reverse ¶
func Reverse[T any](slc []T) []T
Reverse order of slice elements As per .NET Array.Reverse(Array).
func ReverseSubset ¶
Reverse a subset of slice elements As per .NET Array.Reverse(Array, Int32, Int32).
Types ¶
type ElementType ¶
type ElementType[T any] struct { Collection collections.Collection[T] Version int ValueP *T local.InternalImpl }
Concrete representation of Element interface.
func NewElementType ¶
func NewElementType[T any](collection collections.Collection[T], val *T) *ElementType[T]
func (*ElementType[T]) Value ¶
func (e *ElementType[T]) Value() T
func (*ElementType[T]) ValuePtr ¶
func (e *ElementType[T]) ValuePtr() *T
type IteratorBase ¶
type IteratorBase[T any] struct { Version int NilElement collections.Element[T] }
Properties shared by all iterator types.