|
||||||||||
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]+
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
static Version |
DEFAULT_VERSION
The default version "1.0". |
private String |
original
|
private int[] |
parts
|
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 Version DEFAULT_VERSION
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 Object
public int hashCode()
hashCode
in class Object
public 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.
- Overrides:
equals
in class Object
- Parameters:
object
- The Version
object to be compared.
- Returns:
- true if the two objects are equal.
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-2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |