summaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-26 05:14:20 +0200
committerSven Gothel <[email protected]>2013-04-26 05:14:20 +0200
commitb5ede1f7779bb55e25df4a5724c72f79d8f96640 (patch)
tree7fac57669293627e6002b0adec27518b7fb323fb /src/java
parentef274002b64850b275fe9867026a89987b3169e0 (diff)
VersionNumber*: Add static final 'zeroVersion' for convenience and identity.
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/jogamp/common/util/VersionNumber.java6
-rw-r--r--src/java/com/jogamp/common/util/VersionNumberString.java3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/java/com/jogamp/common/util/VersionNumber.java b/src/java/com/jogamp/common/util/VersionNumber.java
index 806c187..db40a90 100644
--- a/src/java/com/jogamp/common/util/VersionNumber.java
+++ b/src/java/com/jogamp/common/util/VersionNumber.java
@@ -38,6 +38,9 @@ import java.util.regex.Matcher;
*/
public class VersionNumber implements Comparable<Object> {
+ /** A {@link #isZero() zero} version instance. */
+ public static final VersionNumber zeroVersion = new VersionNumber(0, 0, 0);
+
protected final int major, minor, sub;
/** Explicit version number instantiation. */
@@ -80,7 +83,8 @@ public class VersionNumber implements Comparable<Object> {
minor = val[1];
sub = val[2];
}
-
+
+ /** Returns <code>true</code>, if all version components are zero, otherwise <code>false</code>. */
public final boolean isZero() {
return major == 0 && minor == 0 && sub == 0;
}
diff --git a/src/java/com/jogamp/common/util/VersionNumberString.java b/src/java/com/jogamp/common/util/VersionNumberString.java
index 342fa9a..7e68aea 100644
--- a/src/java/com/jogamp/common/util/VersionNumberString.java
+++ b/src/java/com/jogamp/common/util/VersionNumberString.java
@@ -34,6 +34,9 @@ package com.jogamp.common.util;
*/
public class VersionNumberString extends VersionNumber {
+ /** A {@link #isZero() zero} version instance. */
+ public static final VersionNumberString zeroVersion = new VersionNumberString(0, 0, 0, "n/a");
+
protected final String strVal;
public VersionNumberString(int majorRev, int minorRev, int subMinorRev, String versionString) {