套件 | mx.core |
類別 | public class DeferredInstanceFromFunction |
繼承 | DeferredInstanceFromFunction Object |
實作 | ITransientDeferredInstance |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
getInstance()
method to
create an instance of an object when it is first needed and get
a reference to the object thereafter.
相關 API 元素
公用方法
方法 | 定義自 | ||
---|---|---|---|
Constructor. | DeferredInstanceFromFunction | ||
Returns a reference to an instance of the desired object. | DeferredInstanceFromFunction | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
Resets the state of our factory to the initial, uninitialized state. | DeferredInstanceFromFunction | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
建構函式詳細資料
DeferredInstanceFromFunction | () | 建構函式 |
public function DeferredInstanceFromFunction(generator:Function, destructor:Function = null)
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
參數generator:Function — A function that creates and returns an instance
of the required object.
| |
destructor:Function (default = null ) — An optional function used to cleanup outstanding
references when reset() is called.
|
方法詳細資訊
getInstance | () | 方法 |
public function getInstance():Object
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Returns a reference to an instance of the desired object.
If no instance of the required object exists, calls the function
specified in this class' generator
constructor parameter.
Object — An instance of the object.
|
reset | () | 方法 |
public function reset():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Resets the state of our factory to the initial, uninitialized state. The reference to our cached instance is cleared.
Tue Jun 12 2018, 03:47 PM Z