From b5ede1f7779bb55e25df4a5724c72f79d8f96640 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 26 Apr 2013 05:14:20 +0200 Subject: VersionNumber*: Add static final 'zeroVersion' for convenience and identity. --- src/java/com/jogamp/common/util/VersionNumber.java | 6 +++++- src/java/com/jogamp/common/util/VersionNumberString.java | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/java/com/jogamp/common') 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 { + /** 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 { minor = val[1]; sub = val[2]; } - + + /** Returns true, if all version components are zero, otherwise false. */ 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) { -- cgit v1.2.3