|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.IstiVersion
Class IstiVersion describes a particular version of something: a product, API, etc.
Field Summary | |
static java.lang.String |
BETA_STRING
Beta string. |
static java.lang.String |
DIVIDER
Divider string for version numbers. |
Constructor Summary | |
IstiVersion(int[] args)
Creates a version that isn't a beta version. |
|
IstiVersion(int[] args,
boolean beta)
Creates a version. |
|
IstiVersion(int major,
int minor)
Creates a version that isn't a beta version. |
|
IstiVersion(int major,
int minor,
int patch)
Creates a version that isn't a beta version. |
|
IstiVersion(int major,
int minor,
int patch,
int build)
Creates a version that isn't a beta version. |
|
IstiVersion(int major,
int minor,
int patch,
int build,
boolean beta)
Creates a version. |
|
IstiVersion(java.lang.String complete)
Creates a version. |
|
IstiVersion(java.lang.String[] args)
Creates a version that isn't a beta version. |
|
IstiVersion(java.lang.String[] args,
boolean beta)
Creates a version. |
|
IstiVersion(java.lang.String major,
java.lang.String minor)
Creates a version that isn't a beta version. |
|
IstiVersion(java.lang.String major,
java.lang.String minor,
java.lang.String patch)
Creates a version that isn't a beta version. |
|
IstiVersion(java.lang.String major,
java.lang.String minor,
java.lang.String patch,
java.lang.String build)
Creates a version that isn't a beta version. |
|
IstiVersion(java.lang.String major,
java.lang.String minor,
java.lang.String patch,
java.lang.String build,
boolean beta)
Creates a version. |
Method Summary | |
int |
compareTo(IstiVersion o)
Compares this IstiVersion with the specified IstiVersion. |
int |
compareTo(java.lang.Object o)
Compares this IstiVersion with the specified IstiVersion. |
protected java.lang.String |
createVersionString()
Creates the version string. |
boolean |
equals(IstiVersion o)
Compares this IstiVersion to the specified object. |
boolean |
equals(java.lang.Object o)
Compares this IstiVersion to the specified object. |
protected static int[] |
getArgs(java.lang.String complete)
Gets the arguments specified by the complete version string. |
protected static int[] |
getArgs(java.lang.String[] args)
Gets the arguments specified by argument strings. |
int |
getBuild()
Gets the build. |
(package private) int |
getMajor()
Get the major version. |
int |
getMinor()
Gets the minor version. |
int |
getPatch()
Gets the patch version. |
boolean |
isBeta()
Determines if this is a beta version. |
protected static boolean |
isBeta(java.lang.String complete)
Determines if the complete version string contains beta. |
protected static int |
parseInt(java.lang.String s)
Parses the string argument as a signed decimal integer. |
java.lang.String |
toString()
Returns a string representation of this version. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String BETA_STRING
public static final java.lang.String DIVIDER
Constructor Detail |
public IstiVersion(java.lang.String complete)
complete
- the complete version string.public IstiVersion(int major, int minor)
major
- the major version.minor
- the minor version.public IstiVersion(java.lang.String major, java.lang.String minor)
major
- the major version.minor
- the minor version.public IstiVersion(int major, int minor, int patch)
major
- the major version.minor
- the minor version.patch
- the patch version.public IstiVersion(java.lang.String major, java.lang.String minor, java.lang.String patch)
major
- the major version.minor
- the minor version.patch
- the patch version.public IstiVersion(int major, int minor, int patch, int build)
major
- the major version.minor
- the minor version.patch
- the patch version.build
- the build version.public IstiVersion(int major, int minor, int patch, int build, boolean beta)
major
- the major version.minor
- the minor version.patch
- the patch version.build
- the build version.beta
- true if beta, false otherwise.public IstiVersion(java.lang.String major, java.lang.String minor, java.lang.String patch, java.lang.String build)
major
- the major version.minor
- the minor version.patch
- the patch version.build
- the build version.public IstiVersion(java.lang.String major, java.lang.String minor, java.lang.String patch, java.lang.String build, boolean beta)
major
- the major version.minor
- the minor version.patch
- the patch version.build
- the build version.beta
- true if beta, false otherwise.public IstiVersion(int[] args)
args
- an array of versions.public IstiVersion(int[] args, boolean beta)
args
- an array of versions.beta
- true if beta, false otherwise.public IstiVersion(java.lang.String[] args)
args
- an array of versions.public IstiVersion(java.lang.String[] args, boolean beta)
args
- an array of versions.beta
- true if beta, false otherwise.Method Detail |
protected java.lang.String createVersionString()
protected static int[] getArgs(java.lang.String complete)
complete
- the complete version string.
protected static int[] getArgs(java.lang.String[] args)
args
- the argument strings.
protected static boolean isBeta(java.lang.String complete)
complete
- the complete version string.
protected static int parseInt(java.lang.String s)
s
- a string.
public int compareTo(java.lang.Object o)
compareTo(IstiVersion)
. Otherwise, it throws a
ClassCastException
(as Versions are comparable
only to other Versions).
compareTo
in interface java.lang.Comparable
o
- the Object
to be compared.
0
if the versions are equal;
a value less than 0
if this version
is less than the specified version;
and a value greater than 0
if this version
is greater than the specified version.
ClassCastException
- if the argument is not a
IstiVersion
.public int compareTo(IstiVersion o)
o
- the Object
to be compared.
0
if the versions are equal;
a value less than 0
if this version
is less than the specified version;
and a value greater than 0
if this version
is greater than the specified version.public boolean equals(java.lang.Object o)
true
if and only if the argument is not
null
and is a IstiVersion
object that represents
the same version as this object.
o
- the Object
to be compared.
true
if the IstiVersion
are equal;
false
otherwise.public boolean equals(IstiVersion o)
true
if and only if the argument is not
null
and is a IstiVersion
object that represents
the same version as this object.
o
- the Object
to be compared.
true
if the IstiVersion
are equal;
false
otherwise.public int getBuild()
int getMajor()
public int getMinor()
public int getPatch()
public boolean isBeta()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |