tyrex.util

Class Version

public class Version extends Object

Prints version information to the console. To print version information from the command line:

java com.intalio.n3.util.Version

Version: $Revision: 1.3 $ $Date: 2001/03/19 17:39:03 $

Author: Assaf Arkin

Method Summary
static booleanisCompatibleWith(String available, String required)
Returns true if the available version is compatible with the required version.
static voidmain(String[] args)

Method Detail

isCompatibleWith

public static boolean isCompatibleWith(String available, String required)
Returns true if the available version is compatible with the required version. Compatibility is defined as the available version being equal to or larger than the required version.

A version string is made up of several numerical components with the most significant one coming first (e.g. 2.1.0 or 99/12/25). The version components are compared one by one starting with the most significant. All version components are compared, if they are missing in their version, zero is assumed (2.1 is equivalent to 2.1.0.0).

Available version 2.x will be compatible with required version 1.x, 1.0 and 1 (the last two are the same) but not with required version 3.x. 2.x will be compatible with 2.y if x and y are independently compatible according to the same rules.

The supported version separators are . , / -.

True: available >= required

Parameters: available The available version number required The ninimum required version number

Returns: True if available equals to or larger than the required

main

public static void main(String[] args)
Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.