|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.ic.util.Version
public class Version
The Version class represents any version of something (e.g. a Product). The version supports up to 4 sub-parts in the form of A.B.C.D and a string suffix. Each of the A.B.C.D parts must be an integer. For each part, the part before it must be present. The "A" part is required while the other parts are optional. The suffix is optional and may be present regardless of any of the parts before it.
| Constructor Summary | |
|---|---|
Version(java.lang.Integer a,
java.lang.Integer b,
java.lang.Integer c,
java.lang.Integer d,
java.lang.String suffix)
Constructs a version based on the individual pieces. |
|
Version(java.lang.String version)
Constructs a version object based on a string representation of one. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object versionObject)
Compares the passed in version with this version. |
boolean |
equals(java.lang.Object versionObject)
Determines if 2 versions are equal. |
java.lang.Integer |
getA()
Gets the "A" portion of the version. |
java.lang.Integer |
getB()
Gets the "B" portion of the version. |
java.lang.Integer |
getC()
Gets the "C" portion of the version. |
java.lang.Integer |
getD()
Gets the "D" portion of the version. |
java.lang.String |
getSuffix()
Gets the suffix portion of the version. |
java.lang.String |
toString()
Returns the string representation of the version in the form of "A.B.C.D Suffix". |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Version(java.lang.Integer a,
java.lang.Integer b,
java.lang.Integer c,
java.lang.Integer d,
java.lang.String suffix)
throws java.lang.IllegalArgumentException
a - The A part of the version.b - The B part of the version.c - The C part of the version.d - The D part of the version.suffix - The suffix part of the version.
java.lang.IllegalArgumentException - if the format is invalid.
public Version(java.lang.String version)
throws java.lang.IllegalArgumentException
version - The version in the form of "A.B.C.D Suffix" as a string.
java.lang.IllegalArgumentException - if the format is invalid.| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object versionObject)
equals in class java.lang.ObjectversionObject - The Version to compare.
public int compareTo(java.lang.Object versionObject)
compareTo in interface java.lang.ComparableversionObject - the version to compare.
public java.lang.Integer getA()
public java.lang.Integer getB()
public java.lang.Integer getC()
public java.lang.Integer getD()
public java.lang.String getSuffix()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||