Appearance
KBE3D / KBCore / Cesium / PropertyBag
类: PropertyBag
A Property whose value is a key-value mapping of property names to the computed value of other properties.
参数
An object, containing key-value mapping of property names to properties.
参数
A function that will be called when the value of any of the properties in value are not a Property.
继承
Record<string,any>
实现
Record<string,any>
可索引
[key: string]: any
属性
propertyNames
propertyNames:
any[]
Gets the names of all properties registered on this instance.
isConstant
readonlyisConstant:boolean
Gets a value indicating if this property is constant. This property is considered constant if all property items in this object are constant.
definitionChanged
readonlydefinitionChanged:Event
Gets the event that is raised whenever the set of properties contained in this object changes, or one of the properties itself changes.
方法
hasProperty()
hasProperty(
propertyName:string):boolean
Determines if this object has defined a property with the given name.
参数
propertyName
string
The name of the property to check for.
返回
boolean
True if this object has defined a property with the given name, false otherwise.
addProperty()
addProperty(
propertyName:string,value?:any,createPropertyCallback?: (...params:any[]) =>any):void
Adds a property to this object.
参数
propertyName
string
The name of the property to add.
value?
any
The value of the new property, if provided.
createPropertyCallback?
(...params: any[]) => any
A function that will be called when the value of this new property is set to a value that is not a Property.
返回
void
removeProperty()
removeProperty(
propertyName:string):void
Removed a property previously added with addProperty.
参数
propertyName
string
The name of the property to remove.
返回
void
getValue()
getValue(
time?:JulianDate,result?:any):any
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.
参数
time?
The time for which to retrieve the value. If omitted, the current system time is used.
result?
any
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.
返回
any
The modified result parameter or a new instance if the result parameter was not supplied.
merge()
merge(
source:any,createPropertyCallback?: (...params:any[]) =>any):void
Assigns each unassigned property on this object to the value of the same property on the provided source object.
参数
source
any
The object to be merged into this object.
createPropertyCallback?
(...params: any[]) => any
A function that will be called when the value of any of the properties in value are not a Property.
返回
void
equals()
equals(
other?:Property):boolean
Compares this property to the provided property and returns <code>true</code> if they are equal, <code>false</code> otherwise.
参数
other?
The other property.
返回
boolean
true if left and right are equal, false otherwise.
构造函数
构造函数
new PropertyBag(
value?:any,createPropertyCallback?: (...params:any[]) =>any):PropertyBag
参数
value?
any
createPropertyCallback?
(...params: any[]) => any
返回
PropertyBag
继承自
Record<string, any>.constructor
