|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crosswire.common.util.Version
public class Version
Version is an immutable representation of dotted "number" consisting of 1 to 4 parts.
Here is the grammar for version strings:
version ::= major('.'minor('.'micro('.'nano)?)?)?
major ::= [0-9]+
minor ::= [0-9]+
micro ::= [0-9]+
nano ::= [0-9]+
The GNU Lesser General Public License for details.| Field Summary | |
|---|---|
private String |
original
|
private int[] |
parts
|
static Pattern |
VERSION_PATTERN
|
| Constructor Summary | |
|---|---|
Version(String version)
Created a version identifier from the specified string. |
|
| Method Summary | |
|---|---|
int |
compareTo(Version object)
Compares this Version object to another object. |
boolean |
equals(Object object)
Compares this Version object to another object. |
int |
hashCode()
|
String |
toString()
Returns the original string representation of this version identifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern VERSION_PATTERN
private final String original
private final int[] parts
| Constructor Detail |
|---|
public Version(String version)
version - String representation of the version identifier.
IllegalArgumentException - If version is improperly
formatted.| Method Detail |
|---|
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object object)
Version object to another object.
A version is considered to be equal to another version if all the parts are equal.
equals in class Objectobject - The Version object to be compared.
public int compareTo(Version object)
Version object to another object.
The comparison considers each of the parts (major, minor, micro, nano) in turn, comparing like with like. At any point the comparison is not equal, a result is known.
compareTo in interface Comparable<Version>object - The Version object to be compared.
Version object.
ClassCastException - If the specified object is not a Version.
|
Copyright ยจ 2003-2015 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||