Extension methods for the .NET object sequence
VectorExtensions
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| All | 1 | Does all boolean test result is TRUE? |
| Sort | 2 | |
| Replicate | 1 | 使用template产生一个n长度元素的目标序列 |
| Append | 4 | Dynamics add a element into the target array. |
| Fill | 2 | 在原来的数组末尾追加由count个item填充的新数据 |
| Delete | 2 | Removes array element at index. |
| VectorShadows | 1 | Create a vector shadow of your data collection. |
| Coalesce | 1 | 聚合,将nullable类型结构体转换为原来的值类型 |
| GetRange | 1 | 从所给定的数组之中获取得到指定位置范围内的数据 |
| MappingData | 1 | 用来生成map数据的, + 当两个向量长度相同,会不进行任何处理,即两个向量之间,元素都可以一一对应, + 但是当某一个向量的长度为1的时候,就会将该向量补齐,因为此时会是一对多的关系 |
| IndexOf | 1 | 在一个一维数组中搜索指定对象,并返回其首个匹配项的索引。 |
| Last | 1 | 从后往前访问集合之中的元素,请注意请不要使用Linq查询表达式,尽量使用list或者array |
| After | 2 | 取出在x元素之后的所有元素 |
| Memset | 1 | Replace target array data by using specific object value.(替换目标向量为指定的对象的填充数据) |
| Memset | 1 | 替换s字符串变量数据为新的字符填充数据 |
| Midv | 1 | Strings.Mid()) function like operation on any type collection data. |
| LoadAsNumericVector | 1 | Load the text file as a numeric vector. |
| Split | 1 | Split the object array using a specific evaluation function. |
| CopyOf | 2 | java arrays.copyOf |
| RotateLeft | 1 | |
| RotateRight | 1 | |
| PadLeft | 1 | |
| SetValue | 1 | |
| Sort | 1 | |
| Replicate | 1 | |
| Construct | 1 | |
| RepeatCalls | 1 | |
| Append | 1 | |
| Fill | 2 | |
| Delete | 1 | |
| InsertAt | 1 | |
| VectorShadows | 1 | |
| Coalesce | 1 | |
| GetRange | 1 | |
| MappingData | 1 | |
| IndexOf | 1 | |
| Last | 1 | |
| After | 1 | |
| Midv | 1 | |
| Split | 1 | |
| CopyOf | 2 |
03 Members
IEnumerable(Of Boolean))Does all boolean test result is TRUE?
| Name | Type | Description |
|---|---|---|
flags | IEnumerable(Of Boolean) | - |
``0(), Comparison(Of ``0), Boolean)| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
a | ``0() | - |
compares | Comparison(Of ``0) | - |
modification | Boolean | 是否修改原始输入的a序列? 否则会创建一个新的数组序列返回 |
IEnumerable(Of ``0), Func(Of ``0, IComparable), Boolean)对目标序列进行排序生成新的序列,这个拓展函数尝试将升序排序和降序排序这两种操作的接口统一起来
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | - |
desc | Func(Of ``0, IComparable) | - |
``0, Int32)使用template产生一个n长度元素的目标序列
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
template | ``0 | - |
n | Int32 | the size of the generated sequence |
``0(), ``0)Dynamics add a element into the target array.
(注意:不推荐使用这个函数来频繁的向数组中添加元素,这个函数会频繁的分配内存,效率非常低,这个函数会修改原始的vector输入)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
value | ``0 | - |
``0(), IEnumerable(Of ``0))Append value collection to the end of the target vector
这个函数会修改原始的vector输入
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
values | IEnumerable(Of ``0) | - |
``0(), ``0())Add given elements into an array object.
(会自动跳过空集合,这个方法是安全的,这个函数会修改原始的vector输入)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
value | ``0() | - |
``0(), List(Of ``0))Add given elements into an array object.
这个函数会修改原始的array输入
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
array | ``0() | - |
value | List(Of ``0) | - |
``0(), ``0, Int32)在原来的数组末尾追加由count个item填充的新数据
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
item | ``0 | - |
count% | Int32 | - |
使用给定的数据序列data填充vector的指定位置开始的区域 填充的长度为data的序列长度
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
data | IEnumerable(Of ``0) | - |
start% | i32 | - |
``0(), Int32)Removes array element at index.
(请注意,这个函数并不会修改原来的数组,而是创建一个新的拷贝)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
index | Int32 | - |
IEnumerable(Of ``0), IEnumerable(Of Int32))将指定下标的元素从原始的输入序列之中删除然后返回所得到的新序列
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | IEnumerable(Of ``0) | 原始序列不会被改变 |
index | IEnumerable(Of Int32) | - |
IEnumerable(Of ``0))Create a vector shadow of your data collection.
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | - |
返回Object类型是为了简化语法
IEnumerable(Of Nullable(Of ``0)))聚合,将nullable类型结构体转换为原来的值类型
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of Nullable(Of ``0)) | - |
``0(), Int32, Int32)从所给定的数组之中获取得到指定位置范围内的数据
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
vector | ``0() | - |
index% | Int32 | - |
count% | Int32 | - |
``0(), ``0())用来生成map数据的,
- 当两个向量长度相同,会不进行任何处理,即两个向量之间,元素都可以一一对应,
- 但是当某一个向量的长度为1的时候,就会将该向量补齐,因为此时会是一对多的关系
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
a | ``0() | - |
b | ``0() | - |
``0(), ``0)在一个一维数组中搜索指定对象,并返回其首个匹配项的索引。
this function returns -1 always if the given array is nothing
| Name | Description |
|---|---|
T | 数组元素的类型。 |
| Name | Type | Description |
|---|---|---|
array | ``0() | 要搜索的从零开始的一维数组。 |
o | ``0 | 要在 array 中查找的对象。 |
如果在整个 array 中找到 value 的第一个匹配项,则为该项的从零开始的索引;否则为 -1。
IEnumerable(Of ``0), Int32)从后往前访问集合之中的元素,请注意请不要使用Linq查询表达式,尽量使用list或者array
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | 请不要使用Linq查询表达式,尽量使用 |
index | Int32 | - |
IEnumerable(Of ``0), ``0)取出在x元素之后的所有元素
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | - |
x | ``0 | - |
IEnumerable(Of ``0), Predicate(Of ``0))Returns all of the elements which is after the element that detected by a specific evaluation function predicate. (取出在判定条件成立的元素之后的所有元素)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | - |
predicate | Predicate(Of ``0) | - |
``0(), ``0, Int32)Replace target array data by using specific object value.(替换目标向量为指定的对象的填充数据)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
array | ``0() | - |
o | ``0 | - |
len | Int32 | - |
String, Char, Int32)替换s字符串变量数据为新的字符填充数据
| Name | Type | Description |
|---|---|---|
s | String | - |
c | Char | - |
len | Int32 | - |
IEnumerable(Of ``0), Int32, Int32)Strings.Mid() function like operation on any type collection data.
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | - |
start | Int32 | 0 base |
length | Int32 | - |
String)Load the text file as a numeric vector. Each line in the text file should be a Double type numeric value.
| Name | Type | Description |
|---|---|---|
path | String | - |
Split the object array using a specific evaluation function. (Please note that, all of the object in the source array that match the delimiter evaluation, will not includes in the returned tokens.)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
source | IEnumerable(Of ``0) | - |
delimiter | Predicate(Of ``0) | 和字符串的Split函数一样,这里作为delimiter的元素都不会出现在结果之中 |
deliPosition | DelimiterLocation | 是否还应该在分区的结果之中包含有分隔符对象?默认不包含 |
``0(), Int32)java arrays.copyOf
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
a | ``0() | - |
newLen | Int32 | - |
``0(), Int32(), Boolean)default index ordinals offset value is zero-based.
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
v | ``0() | - |
ordinals | Int32() | - |
base1 | Boolean | - |
T(), Int32)T(), Int32)T(), T, Int32)T(), Comparison(Of T), Boolean)T, Int32)Int32)Func(Of T), Int32, Int32)T(), T)T(), T, Int32)T(), Int32)T(), T, Int32)IEnumerable(Of T))IEnumerable(Of Nullable(Of T)))T(), Int32, Int32)T(), T())T(), T)IEnumerable(Of T), Int32)IEnumerable(Of T), T)IEnumerable(Of T), Int32, Int32)T(), Int32)T(), Int32(), Boolean)