| Package | vegas.util |
| Class | public class TypeUtil |
TypeUtil utility class is an all-static class with methods for checking and working with the type of the object in AS2.
| Method | Defined by | ||
|---|---|---|---|
|
compare(o1:*, o2:*):Boolean
[static]
Compares the types of two objects.
| TypeUtil | ||
|
isExplicitInstanceOf(o:*, c:*):Boolean
[static]
Checks if the passed-in object is an explicit instance of the passed-in class.
| TypeUtil | ||
|
isGenericObject(o:*):Boolean
[static]
Checks if the passed-in object is a generic object.
| TypeUtil | ||
|
isInstanceOf(o:*, type:*):Boolean
[static]
Checks if the passed-in object is an instance of the passed-in type.
| TypeUtil | ||
|
isPrimitive(o:*):Boolean
[static]
Checks if the passed-in object is a primitive type.
| TypeUtil | ||
|
isTypeOf(o:*, type:String):Boolean
[static]
Checks if the result of an execution of the typeof method on the passed-in object matches the passed-in type.
| TypeUtil | ||
|
typesMatch(o:*, type:*):Boolean
[static]
Checks if the type of the passed-in object matches the passed-in type.
| TypeUtil | ||
| Constant | Defined by | ||
|---|---|---|---|
| BOOLEAN : String = "boolean" [static]
The type of the 'boolean' objects.
| TypeUtil | ||
| DATE : String = "date" [static]
The type of the 'date' objects.
| TypeUtil | ||
| ERROR : String = "error" [static]
The type of the 'error' objects.
| TypeUtil | ||
| FUNCTION : String = "function" [static]
The type of the 'function' objects.
| TypeUtil | ||
| INT : String = "int" [static]
The type of the 'int' objects.
| TypeUtil | ||
| NULL : String = "null" [static]
The type of the 'null' objects.
| TypeUtil | ||
| NUMBER : String = "number" [static]
The type of the 'number' objects.
| TypeUtil | ||
| OBJECT : String = "object" [static]
The type of the 'object' objects.
| TypeUtil | ||
| STRING : String = "string" [static]
The type of the 'string' objects.
| TypeUtil | ||
| UINT : String = "uint" [static]
The type of the 'uint' objects.
| TypeUtil | ||
| UNDEFINED : String = "undefined" [static]
The type of the 'undefined' objects.
| TypeUtil | ||
| XML : String = "xml" [static]
The type of the 'xml' objects.
| TypeUtil | ||
| compare | () | method |
public static function compare(o1:*, o2:*):BooleanCompares the types of two objects.
Parameterso1:* |
|
o2:* |
Boolean — true if the two objects are the same primitive type.
|
| isExplicitInstanceOf | () | method |
public static function isExplicitInstanceOf(o:*, c:*):BooleanChecks if the passed-in object is an explicit instance of the passed-in class.
Parameterso:* |
|
c:* |
Boolean — true if the passed-in object is an explicit instance of the passed-in class.
|
| isGenericObject | () | method |
public static function isGenericObject(o:*):BooleanChecks if the passed-in object is a generic object.
Parameterso:* |
Boolean — true if the passed-in object is a generic object.
|
| isInstanceOf | () | method |
public static function isInstanceOf(o:*, type:*):BooleanChecks if the passed-in object is an instance of the passed-in type.
Parameterso:* |
|
type:* |
Boolean — true if the passed-in object is an instance of the passed-in type.
|
| isPrimitive | () | method |
public static function isPrimitive(o:*):BooleanChecks if the passed-in object is a primitive type.
Parameterso:* |
Boolean — true if the passed-in object is a primitive type.
|
| isTypeOf | () | method |
public static function isTypeOf(o:*, type:String):BooleanChecks if the result of an execution of the typeof method on the passed-in object matches the passed-in type.
Parameterso:* |
|
type:String |
Boolean — true if the result of an execution of the typeof method on the passed-in object matches the passed-in type.
|
| typesMatch | () | method |
public static function typesMatch(o:*, type:*):BooleanChecks if the type of the passed-in object matches the passed-in type.
Example :
import vegas.util.TypeUtil ;
var s1:String = "hello world" ;
var s2:String = new String("hello world") ;
trace("s1 is string : " + TypeUtil.typesMatch( s1, String )) ; // output : 'true'
trace("s2 is string : " + TypeUtil.typesMatch( s2, String )) ; // output : 'true'
o:* |
|
type:* |
Boolean |
| BOOLEAN | constant |
public static const BOOLEAN:String = "boolean"The type of the 'boolean' objects.
| DATE | constant |
public static const DATE:String = "date"The type of the 'date' objects.
| ERROR | constant |
public static const ERROR:String = "error"The type of the 'error' objects.
| FUNCTION | constant |
public static const FUNCTION:String = "function"The type of the 'function' objects.
| INT | constant |
public static const INT:String = "int"The type of the 'int' objects.
| NULL | constant |
public static const NULL:String = "null"The type of the 'null' objects.
| NUMBER | constant |
public static const NUMBER:String = "number"The type of the 'number' objects.
| OBJECT | constant |
public static const OBJECT:String = "object"The type of the 'object' objects.
| STRING | constant |
public static const STRING:String = "string"The type of the 'string' objects.
| UINT | constant |
public static const UINT:String = "uint"The type of the 'uint' objects.
| UNDEFINED | constant |
public static const UNDEFINED:String = "undefined"The type of the 'undefined' objects.
| XML | constant |
public static const XML:String = "xml"The type of the 'xml' objects.