Packagejp.nium.version
Classpublic class Version
InheritanceVersion Inheritance Object

Version クラスは、バージョン情報を格納し、バージョンの比較などを行うためのモデルクラスです。 Version class is a model class to store the version information and compare the version.

View the examples



Public Properties
 PropertyDefined By
  buildVersion : int
[read-only] ビルドバージョンを取得します。 Get the build version.
Version
  majorVersion : int
[read-only] メジャーバージョンを取得します。 Get the major version.
Version
  minorVersion : int
[read-only] マイナーバージョンを取得します。 Get the minor version.
Version
  release : String
[read-only] リリース情報を取得します。 Get the release information.
Version
Public Methods
 MethodDefined By
  
Version(majorVersionOrVersionValue:*, minorVersion:int = 0, buildVersion:int = 0, release:String = null)
新しい Version インスタンスを作成します。 Creates a new Version object.
Version
  
Version インスタンスのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。 Duplicates an instance of an Version subclass.
Version
  
compare(version:Version):int
対象の Version インスタンスを比較した結果を返します。 この比較結果にリリース情報の値は影響しません。 Returns the result of comparison of the Version instance.
Version
  
equals(version:Version):Boolean
2 つのバージョンをリリース情報も含めて完全に一致するかどうかを比較した結果を返します。 Returns the value above 1 if the own version is higher, returns 0 if the version is same and return the value below -1 if the own version is lower.
Version
  
toString():String
指定されたオブジェクトのストリング表現を返します。 Returns the string representation of the specified object.
Version
Property Detail
buildVersionproperty
buildVersion:int  [read-only]

ビルドバージョンを取得します。 Get the build version.


Implementation
    public function get buildVersion():int
majorVersionproperty 
majorVersion:int  [read-only]

メジャーバージョンを取得します。 Get the major version.


Implementation
    public function get majorVersion():int
minorVersionproperty 
minorVersion:int  [read-only]

マイナーバージョンを取得します。 Get the minor version.


Implementation
    public function get minorVersion():int
releaseproperty 
release:String  [read-only]

リリース情報を取得します。 Get the release information.


Implementation
    public function get release():String
Constructor Detail
Version()Constructor
public function Version(majorVersionOrVersionValue:*, minorVersion:int = 0, buildVersion:int = 0, release:String = null)

新しい Version インスタンスを作成します。 Creates a new Version object.

Parameters
majorVersionOrVersionValue:*メジャーバージョン、またはバージョンを表すストリング値です。 The major version or the string value to express the version.
 
minorVersion:int (default = 0)マイナーバージョンです。 The minor version.
 
buildVersion:int (default = 0)ビルドバージョンです。 The build version.
 
release:String (default = null)リリース情報です。 The release information.
Method Detail
clone()method
public function clone():Version

Version インスタンスのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。 Duplicates an instance of an Version subclass.

Returns
Version元のオブジェクトと同じプロパティ値を含む新しい Version インスタンスです。 A new Version object that is identical to the original.
compare()method 
public function compare(version:Version):int

対象の Version インスタンスを比較した結果を返します。 この比較結果にリリース情報の値は影響しません。 Returns the result of comparison of the Version instance. The result of comparison do not affect to the value of release information.

Parameters

version:Version比較したい Version インスタンスです。 The Version instance to compare.

Returns
int自身のバージョンが高ければ 1 以上の数値を、バージョンが同じであれば 0 を、バージョンが低ければ -1 以下の数値です。
equals()method 
public function equals(version:Version):Boolean

2 つのバージョンをリリース情報も含めて完全に一致するかどうかを比較した結果を返します。 Returns the value above 1 if the own version is higher, returns 0 if the version is same and return the value below -1 if the own version is lower.

Parameters

version:Version比較したい Version インスタンスです。 The Version instance to compare.

Returns
Boolean完全に一致する場合には true を、一致しない場合には false です。 Returns true if completly same, otherwise return false.
toString()method 
public function toString():String

指定されたオブジェクトのストリング表現を返します。 Returns the string representation of the specified object.

Returns
Stringオブジェクトのストリング表現です。 A string representation of the object.
Examples
     ver version100:Version = new Version( 1, 0, 0 );
     ver version200:Version = new Version( "2.0.0" );
     trace( version100.compare( version200 ) ); // -3 を返す