套件 | mx.utils |
類別 | public class UIDUtil |
繼承 | UIDUtil Object |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
UIDUtil.createUID()
method.
Note: If you have a dynamic object that has no [Bindable] properties
(which force the object to implement the IUID interface), Flex adds an
mx_internal_uid
property that contains a UID to the object.
To avoid having this field
in your dynamic object, make it [Bindable], implement the IUID interface
in the object class, or set a property with a value.
方法 | 定義自 | ||
---|---|---|---|
[靜態]
Generates a UID (unique identifier) based on ActionScript's
pseudo-random number generator and the current time. | UIDUtil | ||
[靜態]
Converts a 128-bit UID encoded as a ByteArray to a String representation. | UIDUtil | ||
[靜態]
Returns the UID (unique identifier) for the specified object. | UIDUtil | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
[靜態]
A utility method to check whether a String value represents a
correctly formatted UID value. | UIDUtil | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
[靜態]
Converts a UID formatted String to a ByteArray. | UIDUtil | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
createUID | () | 方法 |
public static function createUID():String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Generates a UID (unique identifier) based on ActionScript's pseudo-random number generator and the current time.
The UID has the form
"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
where X is a hexadecimal digit (0-9, A-F).
This UID will not be truly globally unique; but it is the best we can do without player support for UID generation.
傳回值String — The newly-generated UID.
|
fromByteArray | () | 方法 |
public static function fromByteArray(ba:ByteArray):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Converts a 128-bit UID encoded as a ByteArray to a String representation. The format matches that generated by createUID. If a suitable ByteArray is not provided, null is returned.
參數
ba:ByteArray — ByteArray 16 bytes in length representing a 128-bit UID.
|
String — String representation of the UID, or null if an invalid
ByteArray is provided.
|
getUID | () | 方法 |
public static function getUID(item:Object):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Returns the UID (unique identifier) for the specified object. If the specified object doesn't have an UID then the method assigns one to it. If a map is specified this method will use the map to construct the UID. As a special case, if the item passed in is null, this method returns a null UID.
參數
item:Object — Object that we need to find the UID for.
|
String — The UID that was either found or generated.
|
isUID | () | 方法 |
public static function isUID(uid:String):Boolean
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
A utility method to check whether a String value represents a correctly formatted UID value. UID values are expected to be in the format generated by createUID(), implying that only capitalized A-F characters in addition to 0-9 digits are supported.
參數
uid:String — The value to test whether it is formatted as a UID.
|
Boolean — Returns true if the value is formatted as a UID.
|
toByteArray | () | 方法 |
public static function toByteArray(uid:String):ByteArray
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Converts a UID formatted String to a ByteArray. The UID must be in the format generated by createUID, otherwise null is returned.
參數
uid:String — representing a 128-bit UID
|
ByteArray — ByteArray 16 bytes in length representing the 128-bits of the
UID or null if the uid could not be converted.
|
Tue Jun 12 2018, 03:47 PM Z