元编程参考文档

对象操作

8 个节点

本页内容 8

创建对象

函数

A new, empty object that holds no data and equals nothing but itself, useful as a unique marker or as something to lock on.

签名
创建对象() -> 任意
object Create()

返回

结果任意
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

相等

函数

Whether two values are equal, using the first value's own idea of equality (so two texts with the same characters are equal). Two nulls are equal, and a null is never equal to a non-null value; unlike ObjectRoutines.LogicalEquals, either input may be null.

签名
相等(对象 A: 任意, 对象 B: 任意) -> 真否
bool Equals(object objA, object objB)

参数

名称类型默认值说明
对象 A任意—The first value to compare, or null.
对象 B任意—The second value to compare, or null.

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

获取哈希码

函数

The value's hash code, the number dictionaries and sets use to file it. Equal values give equal hash codes, but different values can share one, and some (text, for example) change from one run of the program to the next, so it is not an identifier to store. Throws System.ArgumentNullException when Target is null.

签名
获取哈希码(目标: 任意) -> 整数
int GetHashCode(object target)

参数

名称类型默认值说明
目标任意—The value to hash.

返回

结果整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

获取类型

函数

The actual type of the value at run time, which can be more specific than the type of the wire it arrived on. Throws System.ArgumentNullException when Target is null.

签名
获取类型(目标: 任意) -> Type
Type GetType(object target)

参数

名称类型默认值说明
目标任意—The value to inspect.

返回

结果Type
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

逻辑相等

函数

Whether Target considers itself equal to Obj, by whatever equality its type defines (which may be custom). Throws System.ArgumentNullException when Target is null; use ObjectRoutines.Equals when either side may be null.

签名
逻辑相等(目标: 任意, 对象: 任意) -> 真否
bool LogicalEquals(object target, object obj)

参数

名称类型默认值说明
目标任意—The value whose equality rule is used.
对象任意—The value to compare it with, or null.

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

浅复制

函数

A shallow copy of the value: a new object of the same type whose fields hold the same values as the original's, so any objects it refers to (lists, for example) are shared with the original rather than copied. Throws System.ArgumentNullException when Target is null.

签名
浅复制(目标: 任意) -> 任意
object MemberwiseClone(object target)

参数

名称类型默认值说明
目标任意—The value to copy.

返回

结果任意
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

引用相等

函数

Whether two inputs are the very same object, not merely equal in content; two nulls count as the same. Numbers and other value types are copied separately when passed in, so they never compare as the same object, even with themselves.

签名
引用相等(对象 A: 任意, 对象 B: 任意) -> 真否
bool ReferenceEquals(object objA, object objB)

参数

名称类型默认值说明
对象 A任意—The first object, or null.
对象 B任意—The second object, or null.

返回

结果真否
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库

转为文本

函数

The value's text form, as its type defines it; a type that defines none gives its full type name. A number or a date is written the one way Divooka writes it, whatever region the machine is set to - 1.5, 2026-01-02 14:30:00 - and anything else that can be formatted, in the invariant culture. Throws System.ArgumentNullException when Target is null.

签名
转为文本(目标: 任意) -> 文本
string ToString(object target)

参数

名称类型默认值说明
目标任意—The value to describe.

返回

结果文本

备注

Round 24: the one spelling (Abstraction.ValueText), as Number to Text writes it - it used to write the machine's region's, so the same document gave "1,5" on a German machine.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
对象操作
所属包
标准库