|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.util.Utils
public class Utils
Generic utilities.
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static int |
compareVersion(int[] v1,
int[] v2)
Compares two version. |
static int |
getSubversion(java.lang.String version,
int portion)
Returns a portion of the specified version in an integer, or 0 if no such portion exists. |
static int[] |
parseVersion(java.lang.String version)
Parses the specified version into an array of integer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static final int getSubversion(java.lang.String version, int portion)
For example, getSubversion(0) returns the so-called major version (2 in "2.4.0"), and getSubversion(1) returns the so-called minor version (4 in "2.4.0").
Note: alpha is consider as -500, beta -300, and rc -100. Moreover, beta3 is -497 (= -500 + 3) and rc5 -95 (-100 + 5)
version
- the version. The version is assumed to
a series of integer separated by a non-alphanumeric separator.portion
- which portion of the version; starting from 0.
If you want to retrieve the major version, specify 0.public static final int[] parseVersion(java.lang.String version)
public static final int compareVersion(int[] v1, int[] v2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |