|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gridsystems.utils.Version
public class Version
General Utilities.
Constructor Summary | |
---|---|
Version(int... values)
Creates an instance. |
|
Version(java.lang.String version)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(Version v)
Compares this object to another JavaVersion. |
boolean |
equals(java.lang.Object obj)
|
static double |
getDoubleRepresentation(java.lang.String version)
Deprecated. For comparisons, use #compare(Object) |
int |
getMajorVersion()
Deprecated. Use #getValue(int) instead. |
int |
getMinorVersion()
Deprecated. Use #getValue(int) instead. |
int |
getRelease()
Deprecated. Use #getValue(int) instead. |
int |
getSize()
Get the size (number of elements) of the version. |
static java.lang.String |
getStringRepresentation(double version)
Deprecated. Use #toString() |
static java.lang.String |
getStringRepresentation(double version,
int fields)
Deprecated. Use #toString() |
int |
getValue(int i)
Gets a slice of the version numbers. |
int |
hashCode()
|
java.lang.String |
toString()
Returns a String representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Version(java.lang.String version)
version
- the String from which the version information is obtained.
It is interpreted as an arbitrarily long series of integers separated by
non-digit characters.public Version(int... values)
values
- version numbers (major, minor, release, build, etc.)Method Detail |
---|
public int getValue(int i)
i
- an int with the position (ranging from 0 to
this.getSize() - 1
of the part of the version number wanted;
0 means the major version number; 1 the minor version number and so on.
public int getSize()
public int compareTo(Version v)
compareTo
in interface java.lang.Comparable<Version>
v
- the instance to compare to
this
is minor than
obj
, 0 if both objects represent the same version and 1
otherwise.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getMajorVersion()
public int getMinorVersion()
public int getRelease()
public java.lang.String toString()
toString
in class java.lang.Object
public static double getDoubleRepresentation(java.lang.String version)
version
- the String with the version description.
version
.Version(String)
public static java.lang.String getStringRepresentation(double version, int fields)
version
- a double with the version data.fields
- an int with the number of fields that the resulting String
is expected to have. Setting this value properly allows avoiding rounding
errors due to the use of double.
version
.public static java.lang.String getStringRepresentation(double version)
version
- a double with the version data.
version
.getStringRepresentation(double, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |