| Package | com.google.analytics.utils |
| Class | public class Version |
| Property | Defined by | ||
|---|---|---|---|
| build : uint
Indicates the build value of this version.
| Version | ||
| major : uint
Indicates the major value of this version.
| Version | ||
| minor : uint
Indicates the minor value of this version.
| Version | ||
| revision : uint
Indicates the revision value of this version.
| Version | ||
| Method | Defined by | ||
|---|---|---|---|
|
Version(major:uint = 0, minor:uint = 0, build:uint = 0, revision:uint = 0)
Creates a new Version instance.
| Version | ||
|
equals(o:*):Boolean
We don't really need an equals method as we override the valueOf, we can do something as
var v1:Version = new Version( 1,0,0,0 );
var v2:Version = new Version( 1,0,0,0 );
trace( int(v1) == int(v2) ); //true
A cast to Number/int force the valueOf, not ideal but sufficient, and the same for any other operators. | Version | ||
|
fromNumber(value:Number = 0):Version
[static]
Constructs a Version object from a number.
| Version | ||
|
fromString(value:String = "", separator:String = "."):Version
[static]
Constructs a Version object from a string.
| Version | ||
|
toString(fields:int = 0):String
Returns a string representation of the object.
| Version | ||
|
valueOf():uint
Returns the primitive value of the object.
| Version | ||
| build | property |
build:uint [read-write]Indicates the build value of this version.
Implementation public function get build():uint
public function set build(value:uint):void
| major | property |
major:uint [read-write]Indicates the major value of this version.
Implementation public function get major():uint
public function set major(value:uint):void
| minor | property |
minor:uint [read-write]Indicates the minor value of this version.
Implementation public function get minor():uint
public function set minor(value:uint):void
| revision | property |
revision:uint [read-write]Indicates the revision value of this version.
Implementation public function get revision():uint
public function set revision(value:uint):void
| Version | () | constructor |
public function Version(major:uint = 0, minor:uint = 0, build:uint = 0, revision:uint = 0)Creates a new Version instance.
Parametersmajor:uint (default = 0) — The major value of the version.
|
|
minor:uint (default = 0) — The minor value of the version.
|
|
build:uint (default = 0) — The build value of the version.
|
|
revision:uint (default = 0) — The revision value of the version.
|
| equals | () | method |
public function equals(o:*):BooleanWe don't really need an equals method as we override the valueOf, we can do something as
var v1:Version = new Version( 1,0,0,0 );
var v2:Version = new Version( 1,0,0,0 );
trace( int(v1) == int(v2) ); //true
A cast to Number/int force the valueOf, not ideal but sufficient, and the same for any other operators.
But as we keep IEquatable for now, then we have no reason to not use it.
Parameters
o:* |
Boolean |
| fromNumber | () | method |
public static function fromNumber(value:Number = 0):VersionConstructs a Version object from a number. If the number is zero or negative, or is NaN or Infity returns an empty version object.
Parametersvalue:Number (default = 0) |
Version |
| fromString | () | method |
public static function fromString(value:String = "", separator:String = "."):VersionConstructs a Version object from a string.
Parametersvalue:String (default = "") |
|
separator:String (default = ".") |
Version |
| toString | () | method |
public function toString(fields:int = 0):StringReturns a string representation of the object. By default, the format returned will include only the fields greater than zero
var v:Version = new Version( 1, 5 );
trace( v ); // "1.5"
note :
the fields parameter allow you to force or limit the output format
var v:Version = new Version( 1, 5 );
trace( v.toString( 1 ) ); // "1"
trace( v.toString( 4 ) ); // "1.5.0.0"
format :
fields:int (default = 0) |
String |
| valueOf | () | method |
public function valueOf():uintReturns the primitive value of the object.
Returnsuint — the primitive value of the object.
|