A tuple paired list object model
list
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 5 | construct a new tuple list object from a named slot value collection. |
| add | 2 | add key-value directly, for add content data with possible duplicated names safely, use the list.unique_add()) method. |
| unique_add | 1 | add unique key-value safely |
| add | 1 | cast the given collection as array and then add into current tuple list |
| hasName | 1 | does list.slots has the specific name? |
| hasNames | 1 | check that all name inside the given names is exists in current data list. |
| slotKeys | 1 | get names with uncheck default index |
| listOf | 1 | all value element inside current tuple list is the given element type |
| getNames | 1 | this function may returns nothing if all index names are default index, example as: [[1]] |
| setNames | 1 | 出错会返回错误消息 |
| getValue | 2 | get value or default |
| ctypeInternal | 1 | cast data type |
| asGeneric | 1 | Try cast of the object type value to a generic type value |
| getByIndex | 1 | |
| setByIndex | 1 | set value by index |
| getByName | 2 | If target key name is not found in list, then function will returns nothing |
| getBySynonyms | 1 | get raw value by a set of given synonyms. |
| setByName | 1 | add/updates of the key name associated value data. |
| empty | 2 | Create a tuple list object that contains no data. |
| scalar | 1 | Create a tuple list object that just contains one scalar value |
| set_empty | 1 | create a list with given slot names, but the corresponding slot value is nothing |
| subset | 1 | A shortcut of function list.getByName()) |
| namedValues | 1 | |
| getValue | 1 | |
| asGeneric | 2 | |
| ToString | 1 | |
| GetVector | 1 | |
| GetSlots | 1 | |
| op_Implicit | 1 | |
| checkTuple | 1 |
03 Properties
04 Fields
| Name | Overloads | Summary |
|---|---|---|
| EmptyListWarningMessage | 1 |
05 Members
data clone
| Name | Type | Description |
|---|---|---|
list | list | - |
IDictionary)Create tuple list from a general dictionary set, dictionary value type could be anything
| Name | Type | Description |
|---|---|---|
table | IDictionary | - |
Type)| Name | Type | Description |
|---|---|---|
type | Type |
| Name | Type | Description |
|---|---|---|
type | RType |
ArgumentReference())construct a new tuple list object from a named slot value collection.
| Name | Type | Description |
|---|---|---|
data | ArgumentReference() | a named slot value collection. |
String, Object)add key-value directly, for add content data with possible duplicated names safely, use the list.unique_add() method.
this function has different behaviours when compares with the list.setByName():
- this function just add slot value directly even if the given value is nothing
setByNamefunction will removes slot if the value is nothing
| Name | Type | Description |
|---|---|---|
name | String | - |
value | Object | - |
String, String)add a string value
due to the reason of string is kind of a char collection so that the overlaod of the generic collection add method may caused the incorrect method reference.
create this function for deal with the string value overloads bug.
| Name | Type | Description |
|---|---|---|
name | String | - |
str | String | - |
String, Object)add unique key-value safely
the duplicated name will be resolved safely in this function.
| Name | Type | Description |
|---|---|---|
name | String | duplicated name will be appends a suffix string for avoid the key conflicts |
value | Object | - |
String, IEnumerable(Of ``0))cast the given collection as array and then add into current tuple list
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
name | String | - |
collection | IEnumerable(Of ``0) | - |
String)does list.slots has the specific name?
check for the dictionary key is existsed?
| Name | Type | Description |
|---|---|---|
name | String | - |
String())check that all name inside the given names is exists in current data list.
| Name | Type | Description |
|---|---|---|
names | String() | - |
get names with uncheck default index
all value element inside current tuple list is the given element type
| Name | Type | Description |
|---|---|---|
elementMode | TypeCodes | the element type for test |
this function may returns nothing if all index names are default index, example as: [[1]]
for get key names safely(avoid null reference) in the clr code, expression like slots.Keys.ToArray could be used. analso the function list.slotKeys() works for this situation.
String(), Environment)出错会返回错误消息
| Name | Type | Description |
|---|---|---|
names | String() | - |
envir | Environment | - |
get value or default
this method will evaluate the value Expression to target T automatically.
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
synonym | String() | - |
env | Environment | - |
default | ``0 | the default value. |
get value or default
this method will evaluate the value Expression to target T automatically.
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
name | String | - |
env | Environment | - |
default | ``0 | the default value. |
cast data type
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
value | Object | if value is an expression andalso T type is not an expression, then this function will try to evaluate the expression as value and then cast data type again. |
env | Environment | - |
err | Message | - |
Try cast of the object type value to a generic type value
| Name | Description |
|---|---|
T | the generic type that cast to |
| Name | Type | Description |
|---|---|---|
env | Environment | - |
default | ``0 | the default element generic value if the type cast failure. |
err | Message | gets the error message for the type cast failure from this parameter. |
Int32)the given index value i should be a integer value from 1-based.
| Name | Type | Description |
|---|---|---|
i | Int32 | 1-based index |
set value by index
the given index value i should be a integer value from 1-based.
| Name | Type | Description |
|---|---|---|
i | Int32 | 1-based index |
value | Object | any kind of the clr runtime value to store in this tuple list that associated with this index. |
envir | Environment | - |
String)If target key name is not found in list, then function will returns nothing
| Name | Type | Description |
|---|---|---|
name | String | - |
String())Create a list subset
| Name | Type | Description |
|---|---|---|
names | String() | A specific list keys that will be used for extract the subset elements from the original list to create a new list object. |
String())get raw value by a set of given synonyms.
| Name | Type | Description |
|---|---|---|
synonym | String() | - |
add/updates of the key name associated value data.
NULL value will remove the target slot by name
| Name | Type | Description |
|---|---|---|
name | String | - |
value | Object | - |
envir | Environment | - |
Create a tuple list object that contains no data.
check of the given tuple list object is null or empty?
| Name | Type | Description |
|---|---|---|
list | list | - |
Object)Create a tuple list object that just contains one scalar value
| Name | Type | Description |
|---|---|---|
x | Object | - |
IEnumerable(Of String))create a list with given slot names, but the corresponding slot value is nothing
| Name | Type | Description |
|---|---|---|
slot_names | IEnumerable(Of String) | - |
String())A shortcut of function list.getByName()
| Name | Type | Description |
|---|---|---|
keys | String() | - |
gets the list.slots collection size
get all values collection from the slots symbol.
check of the data list.slots is null or empty or not?
String)Get slot value by name
| Name | Type | Description |
|---|---|---|
name | String | - |
returns nothing if there is no given name exists in the slots
Func(Of Object, T))String())Object)Dictionary(Of String, Object))String())