A
Property 其值是属性名称到其他属性的计算值的键值映射。 whose value is a key-value mapping of property names to the computed value of other properties.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
value |
object | 可选 optional 一个对象,包含属性名称到属性的键值映射。 An object, containing key-value mapping of property names to properties. |
createPropertyCallback |
function | 可选 optional 当 value 中的任何属性的值不是 Property 时将调用的函数。 A function that will be called when the value of any of the properties in value are not a Property. |
成员 Members
readonly definitionChanged : Event
获取每当此对象中包含的属性集更改或其中一个属性本身更改时引发的事件。 Gets the event that is raised whenever the set of properties contained in this object changes, or one of the properties itself changes.
获取一个值,该值指示该属性是否为常量。如果该对象中的所有属性项都是常量,则该属性被视为常量。 Gets a value indicating if this property is constant. This property is considered constant if all property items in this object are constant.
获取在此实例上注册的所有属性的名称。 Gets the names of all properties registered on this instance.
方法 Methods
向该对象添加属性。 Adds a property to this object.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
propertyName |
string | 要添加的属性的名称。 The name of the property to add. |
value |
* | 可选 optional 新财产的价值(如果提供)。 The value of the new property, if provided. |
createPropertyCallback |
function | 可选 optional 当此新属性的值设置为非属性值时将调用的函数。 A function that will be called when the value of this new property is set to a value that is not a Property. |
抛出: Throws:
-
DeveloperError :“propertyName”已经是注册财产。 : "propertyName" is already a registered property.
将此属性与提供的属性进行比较并返回 Compares this property to the provided property and returns
true 如果它们相等, if they are equal, false otherwise.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
other |
Property | 可选 optional 其他财产。 The other property. |
返回: Returns:
true 如果左和右相等, if left and right are equal, false otherwise.
获取该属性的值。每个包含的属性将在给定时间进行评估,总体结果将是一个对象,将属性名称映射到这些值。 Gets the value of this property. Each contained property will be evaluated at the given time, and the overall result will be an object, mapping property names to those values.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
time |
JulianDate |
JulianDate.now()
|
可选 optional 检索值的时间。如果省略,则使用当前系统时间。 The time for which to retrieve the value. If omitted, the current system time is used. |
result |
object | 可选 optional 用于存储值的对象,如果省略,则会创建并返回一个新实例。请注意,结果中不属于此 PropertyBag 的任何属性都将保持原样。 The object to store the value into, if omitted, a new instance is created and returned. Note that any properties in result which are not part of this PropertyBag will be left as-is. |
返回: Returns:
修改后的结果参数或新实例(如果未提供结果参数)。 The modified result parameter or a new instance if the result parameter was not supplied.
确定此对象是否定义了具有给定名称的属性。 Determines if this object has defined a property with the given name.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
propertyName |
string | 要检查的属性的名称。 The name of the property to check for. |
返回: Returns:
如果此对象已定义具有给定名称的属性,则为 true,否则为 false。 True if this object has defined a property with the given name, false otherwise.
将此对象上每个未分配的属性分配给所提供的源对象上相同属性的值。 Assigns each unassigned property on this object to the value of the same property on the provided source object.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
source |
object | 要合并到此对象中的对象。 The object to be merged into this object. |
createPropertyCallback |
function | 可选 optional 当 value 中的任何属性的值不是 Property 时将调用的函数。 A function that will be called when the value of any of the properties in value are not a Property. |
删除了之前使用 addProperty 添加的属性。 Removed a property previously added with addProperty.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
propertyName |
string | 要删除的属性的名称。 The name of the property to remove. |
抛出: Throws:
-
DeveloperError :“propertyName”不是注册财产。 : "propertyName" is not a registered property.
