Definition at line 71 of file DoxygenVersion.java.
Public Member Functions | |
| DoxygenVersion (String releaseMajorMinor, final int orderOfMagnitude) throws NumberFormatException | |
| DoxygenVersion (final String releaseMajorMinor) | |
| final int | compareTo (final Object obj) |
| boolean | isCompatible (String version) |
| final String | toString () |
|
||||||||||||
|
This constructor parses each of the version components for subsequent version-version comparison. This class solves the normal
Definition at line 98 of file DoxygenVersion.java. Referenced by org.doxygen.tools.DoxygenVersion.isCompatible().
00100 {
00101 if (releaseMajorMinor.endsWith("+")) {
00102 upwards = true;
00103 int len = releaseMajorMinor.length();
00104 releaseMajorMinor = releaseMajorMinor.substring(0, len -1);
00105 }
00106 StringTokenizer st =
00107 new StringTokenizer(releaseMajorMinor, ".");
00108
00109 versions = new int[orderOfMagnitude];
00110
00111 for (int i = 0; (i < orderOfMagnitude); i++) {
00112 versions[i] =
00113 Integer.parseInt((String) st.nextToken());
00114 }
00115 }
|
|
|
This constructor assumes a canonical Doxygen version string form. That being Release.Major.Minor.
Definition at line 130 of file DoxygenVersion.java.
00130 {
00131 this(releaseMajorMinor, DEFAULT_MAGNITUDE);
00132 }
|
|
|
This method implements the compareTo() method from the Comparable interface.
Definition at line 152 of file DoxygenVersion.java. References org.doxygen.tools.DoxygenVersion.versions.
00152 {
00153 if (obj instanceof DoxygenVersion) {
00154 DoxygenVersion dv = (DoxygenVersion) obj;
00155
00156 for (int i = 0; (i < versions.length); i++) {
00157 if (this.versions[i] > dv.versions[i]) {
00158 return 1;
00159 } else if (this.versions[i] == dv.versions[i]) {
00160 continue;
00161 } else {
00162 return -1;
00163 }
00164 }
00165 return 0; //Equal
00166 } else {
00167 return -1;
00168 }
00169 }
|
|
|
To check if the given version is compatible with the current version.
Definition at line 179 of file DoxygenVersion.java. References org.doxygen.tools.DoxygenVersion.DoxygenVersion(), and org.doxygen.tools.DoxygenVersion.upwards. Referenced by org.doxygen.tools.DoxygenProcess.checkVersion().
00179 {
00180 DoxygenVersion compatVersion = new DoxygenVersion(version);
00181 if (compatVersion.upwards) {
00182 return (this.compareTo(compatVersion) >= 0);
00183 } else {
00184 return (this.compareTo(compatVersion) == 0);
00185 }
00186 }
|
|
|
This method provides a standard diagnostic method toString().
Definition at line 196 of file DoxygenVersion.java.
00196 {
00197 StringBuffer sb = new StringBuffer();
00198 for (int i = 0; (i < versions.length); i++) {
00199 sb.append(versions[i] + ".");
00200 }
00201 return sb.toString();
00202 }
|
1.3.4