xslice

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 5 Imported by: 4

README

xslice

Dependencies

  • xtesting*

Documents

Types
  • type Equaller func
  • type Lesser func
Variables
  • None
Constants
  • None
Functions
  • func ShuffleSelf(slice []interface{})
  • func Shuffle(slice []interface{}) []interface{}
  • func ShuffleSelfG(slice interface{})
  • func ShuffleG(slice interface{}) interface{}
  • func ReverseSelf(slice []interface{})
  • func Reverse(slice []interface{}) []interface{}
  • func ReverseSelfG(slice interface{})
  • func ReverseG(slice interface{}) interface{}
  • func SortSelf(slice []interface{}, less Lesser)
  • func Sort(slice []interface{}, less Lesser) []interface{}
  • func SortSelfG(slice interface{}, less Lesser)
  • func SortG(slice interface{}, less Lesser) interface{}
  • func StableSortSelf(slice []interface{}, less Lesser)
  • func StableSort(slice []interface{}, less Lesser) []interface{}
  • func StableSortSelfG(slice interface{}, less Lesser)
  • func StableSortG(slice interface{}, less Lesser) interface{}
  • func IndexOf(slice []interface{}, value interface{}) int
  • func IndexOfWith(slice []interface{}, value interface{}, equaller Equaller)
  • func IndexOfG(slice interface{}, value interface{})
  • func IndexOfWithG(slice interface{}, value interface{}, equaller Equaller)
  • func Contains(slice []interface{}, value interface{}) bool
  • func ContainsWith(slice []interface{}, value interface{}, equaller Equaller) bool
  • func ContainsG(slice interface{}, value interface{}) bool
  • func ContainsWithG(slice interface{}, value interface{}, equaller Equaller) bool
  • func Count(slice []interface{}, value interface{}) int
  • func CountWith(slice []interface{}, value interface{}, equaller Equaller) int
  • func CountG(slice interface{}, value interface{}) int
  • func CountWithG(slice interface{}, value interface{}, equaller Equaller) int
  • func Delete(slice []interface{}, value interface{}, n int) []interface{}
  • func DeleteWith(slice []interface{}, value interface{}, n int, equaller Equaller) []interface{}
  • func DeleteG(slice interface{}, value interface{}, n int) interface{}
  • func DeleteWithG(slice interface{}, value interface{}, n int, equaller Equaller) interface{}
  • func DeleteAll(slice []interface{}, value interface{}) []interface{}
  • func DeleteAllWith(slice []interface{}, value interface{}, equaller Equaller) []interface{}
  • func DeleteAllG(slice interface{}, value interface{}) interface{}
  • func DeleteAllWithG(slice interface{}, value interface{}, equaller Equaller) interface{}
  • func Diff(slice1, slice2 []interface{}) []interface{}
  • func DiffWith(slice1, slice2 []interface{}, equaller Equaller) []interface{}
  • func DiffG(slice1, slice2 interface{}) interface{}
  • func DiffWithG(slice1, slice2 interface{}, equaller Equaller) interface{}
  • func Union(slice1, slice2 []interface{}) []interface{}
  • func UnionWith(slice1, slice2 []interface{}, equaller Equaller) []interface{}
  • func UnionG(slice1, slice2 interface{}) interface{}
  • func UnionWithG(slice1, slice2 interface{}, equaller Equaller) interface{}
  • func Intersection(slice1, slice2 []interface{}) []interface{}
  • func IntersectionWith(slice1, slice2 []interface{}, equaller Equaller) []interface{}
  • func IntersectionG(slice1, slice2 interface{}) interface{}
  • func IntersectionWithG(slice1, slice2 interface{}, equaller Equaller) interface{}
  • func ToSet(slice []interface{}) []interface{}
  • func ToSetWith(slice []interface{}, equaller Equaller) []interface{}
  • func ToSetG(slice interface{}) interface{}
  • func ToSetWithG(slice interface{}, equaller Equaller) interface{}
  • func ElementMatch(slice1, slice2 []interface{}) bool
  • func ElementMatchWith(slice1, slice2 []interface{}, equaller Equaller) bool
  • func ElementMatchG(slice1, slice2 interface{}) bool
  • func ElementMatchWithG(slice1, slice2 interface{}, equaller Equaller) bool
  • func Range(min, max, step int) []int
  • func ReverseRange(min, max, step int) []int
Methods
  • None

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []interface{}, value interface{}) bool

Contains returns true if value is in the []interface{} slice.

func ContainsG added in v1.5.0

func ContainsG(slice interface{}, value interface{}) bool

Contains returns true if value is in the []T slice, is the generic function of Contains.

func ContainsWith

func ContainsWith(slice []interface{}, value interface{}, equaller Equaller) bool

ContainsWith returns true if value is in the []interface{} slice with Equaller.

func ContainsWithG added in v1.5.0

func ContainsWithG(slice interface{}, value interface{}, equaller Equaller) bool

ContainsWith returns true if value is in the []T slice with Equaller, is the generic function of ContainsWith.

func Count

func Count(slice []interface{}, value interface{}) int

Count returns the count of value in the []interface{} slice.

func CountG added in v1.5.0

func CountG(slice interface{}, value interface{}) int

CountG returns the count of value in the []T slice, is the generic function of Count.

func CountWith

func CountWith(slice []interface{}, value interface{}, equaller Equaller) int

CountWith returns the count of value in the []interface{} slice with Equaller.

func CountWithG added in v1.5.0

func CountWithG(slice interface{}, value interface{}, equaller Equaller) int

CountWithG returns the count of value in the []T slice with Equaller, is the generic function of CountWith.

func Delete

func Delete(slice []interface{}, value interface{}, n int) []interface{}

Delete deletes value from []interface{} slice in n times.

func DeleteAll

func DeleteAll(slice []interface{}, value interface{}) []interface{}

DeleteAll deletes value from []interface{} slice in all.

func DeleteAllG added in v1.5.0

func DeleteAllG(slice interface{}, value interface{}) interface{}

DeleteAllG deletes value from []T slice in all, is the generic function of DeleteAll.

func DeleteAllWith

func DeleteAllWith(slice []interface{}, value interface{}, equaller Equaller) []interface{}

DeleteAllWith deletes value from []interface{} slice in all with Equaller.

func DeleteAllWithG added in v1.5.0

func DeleteAllWithG(slice interface{}, value interface{}, equaller Equaller) interface{}

DeleteAllWithG deletes value from []T slice in all with Equaller, is the generic function of DeleteAllWith.

func DeleteG added in v1.5.0

func DeleteG(slice interface{}, value interface{}, n int) interface{}

DeleteG deletes value from []T slice in n times, is the generic function of Delete.

func DeleteWith

func DeleteWith(slice []interface{}, value interface{}, n int, equaller Equaller) []interface{}

DeleteWith deletes value from []interface{} slice in n times with Equaller.

func DeleteWithG added in v1.5.0

func DeleteWithG(slice interface{}, value interface{}, n int, equaller Equaller) interface{}

DeleteWithG deletes value from []T slice in n times with Equaller, is the generic function of DeleteWith.

func Diff

func Diff(slice1, slice2 []interface{}) []interface{}

Diff returns the difference of two []interface{} slices.

func DiffG added in v1.5.0

func DiffG(slice1, slice2 interface{}) interface{}

DiffG returns the difference of two []T slices, is the generic function of Diff.

func DiffWith

func DiffWith(slice1, slice2 []interface{}, equaller Equaller) []interface{}

DiffWith returns the difference of two []interface{} slices with Equaller.

func DiffWithG added in v1.5.0

func DiffWithG(slice1, slice2 interface{}, equaller Equaller) interface{}

DiffWithG returns the difference of two []T slices with Equaller, is the generic function of DiffWith.

func ElementMatch added in v1.5.0

func ElementMatch(slice1, slice2 []interface{}) bool

ElementMatch checks if two []interface{} slice equal without order.

func ElementMatchG added in v1.5.0

func ElementMatchG(slice1, slice2 interface{}) bool

ElementMatch checks if two []T slice equal without order, is the generic function of ElementMatch.

func ElementMatchWith added in v1.5.0

func ElementMatchWith(slice1, slice2 []interface{}, equaller Equaller) bool

ElementMatchWith checks if two []interface{} slice equal without order with Equaller.

func ElementMatchWithG added in v1.5.0

func ElementMatchWithG(slice1, slice2 interface{}, equaller Equaller) bool

ElementMatchWith checks if two []T slice equal without order with Equaller, is the generic function of ElementMatchWith.

func IndexOf

func IndexOf(slice []interface{}, value interface{}) int

IndexOf returns the first index of value in the []interface{} slice.

func IndexOfG added in v1.5.0

func IndexOfG(slice interface{}, value interface{}) int

IndexOfG returns the first index of value in the []T slice, is the generic function of IndexOf.

func IndexOfWith

func IndexOfWith(slice []interface{}, value interface{}, equaller Equaller) int

IndexOfWith returns the first index of value in the []interface{} slice with Equaller.

func IndexOfWithG added in v1.5.0

func IndexOfWithG(slice interface{}, value interface{}, equaller Equaller) int

IndexOfWithG returns the first index of value in the []T slice with Equaller, is the generic function of IndexOfWith.

func Intersection

func Intersection(slice1, slice2 []interface{}) []interface{}

Intersection returns the intersection of two []interface{} slices.

func IntersectionG added in v1.5.0

func IntersectionG(slice1, slice2 interface{}) interface{}

IntersectionG returns the intersection of two []T slices, is the generic function of Intersection.

func IntersectionWith

func IntersectionWith(slice1, slice2 []interface{}, equaller Equaller) []interface{}

IntersectionWith returns the intersection of two []interface{} slices with Equaller.

func IntersectionWithG added in v1.5.0

func IntersectionWithG(slice1, slice2 interface{}, equaller Equaller) interface{}

IntersectionWithG returns the intersection of two []T slices with Equaller, is the generic function of IntersectionWith.

func Range added in v1.4.1

func Range(min, max, step int) []int

Range generates a []int slice from min index to max index with step.

func Reverse

func Reverse(slice []interface{}) []interface{}

Reverse reverses the []interface{} slice and returns the result.

func ReverseG added in v1.5.0

func ReverseG(slice interface{}) interface{}

ReverseG reverses the []T slice and returns the result, is the generic function of Reverse.

func ReverseRange added in v1.4.1

func ReverseRange(min, max, step int) []int

ReverseRange generates a reverse []int slice from max index to min index with step.

func ReverseSelf added in v1.5.0

func ReverseSelf(slice []interface{})

ReverseSelf reverses the []interface{} slice directly.

func ReverseSelfG added in v1.5.0

func ReverseSelfG(slice interface{})

ReverseSelfG reverses the []T slice directly, is the generic function of ReverseSelf.

func Shuffle

func Shuffle(slice []interface{}) []interface{}

Shuffle shuffles the []interface{} slice and returns the result.

func ShuffleG added in v1.5.0

func ShuffleG(slice interface{}) interface{}

ShuffleG shuffles the []T slice and returns the result, is the generic function of Shuffle.

func ShuffleSelf added in v1.5.0

func ShuffleSelf(slice []interface{})

ShuffleSelf shuffles the []interface{} slice directly.

func ShuffleSelfG added in v1.5.0

func ShuffleSelfG(slice interface{})

ShuffleSelfG shuffles the []T slice directly, is the generic function of ShuffleSelf.

func Sort added in v1.4.1

func Sort(slice []interface{}, less Lesser) []interface{}

Sort sorts the []interface{} slice with less function and returns the result.

func SortG added in v1.5.0

func SortG(slice interface{}, less Lesser) interface{}

SortG sorts the []T slice with less function and returns the result, is the generic function of Sort.

func SortSelf added in v1.5.0

func SortSelf(slice []interface{}, less Lesser)

SortSelf sorts the []interface{} slice with less function directly.

func SortSelfG added in v1.5.0

func SortSelfG(slice interface{}, less Lesser)

SortSelfG sorts the []T slice with less function directly, is the generic function of SortSelf.

func StableSort added in v1.4.1

func StableSort(slice []interface{}, less Lesser) []interface{}

StableSort sorts the []interface{} slice in stable with less function and returns the result.

func StableSortG added in v1.5.0

func StableSortG(slice interface{}, less Lesser) interface{}

StableSortG sorts the []T slice with in stable less function and returns the result, is the generic function of StableSort.

func StableSortSelf added in v1.5.0

func StableSortSelf(slice []interface{}, less Lesser)

StableSortSelf sorts the []interface{} slice in stable with less function directly.

func StableSortSelfG added in v1.5.0

func StableSortSelfG(slice interface{}, less Lesser)

StableSortSelfG sorts the []T slice in stable with less function directly, is the generic function of StableSortSelf.

func ToSet

func ToSet(slice []interface{}) []interface{}

ToSet removes the duplicate items from []interface{} slice as a set.

func ToSetG added in v1.5.0

func ToSetG(slice interface{}) interface{}

ToSet removes the duplicate items from []T slice as a set, is the generic function of ToSet.

func ToSetWith

func ToSetWith(slice []interface{}, equaller Equaller) []interface{}

ToSetWith removes the duplicate items from []interface{} slice as a set with Equaller.

func ToSetWithG added in v1.5.0

func ToSetWithG(slice interface{}, equaller Equaller) interface{}

ToSetWith removes the duplicate items from []T slice as a set with Equaller, is the generic function of ToSetWith.

func Union

func Union(slice1, slice2 []interface{}) []interface{}

Union returns the union of two []interface{} slices.

func UnionG added in v1.5.0

func UnionG(slice1, slice2 interface{}) interface{}

UnionG returns the union of two []T slices, is the generic function of Union.

func UnionWith

func UnionWith(slice1, slice2 []interface{}, equaller Equaller) []interface{}

UnionWith returns the union of two []interface{} slices with Equaller.

func UnionWithG added in v1.5.0

func UnionWithG(slice1, slice2 interface{}, equaller Equaller) interface{}

UnionWithG returns the union of two []T slices with Equaller, is the generic function of UnionWith.

Types

type Equaller

type Equaller func(i, j interface{}) bool

Equaller represents a equality function for two interface{}, is used in XXXWith methods.

type Lesser added in v1.5.0

type Lesser func(i, j interface{}) bool

Lesser represents a less function for sort, see sort.Interface.

Jump to

Keyboard shortcuts

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