net.datacrow.core
Class Version

java.lang.Object
  extended by net.datacrow.core.Version

public class Version
extends java.lang.Object

A version definition.

Author:
Robert Jan van der Waals

Constructor Summary
Version(int major, int minor, int build, int patch)
          Creates a new version
Version(java.lang.String version)
          Creates a version based on a string representation.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getBuild()
          The build version number
 java.lang.String getFullString()
          Full string representation of the current version.
 int getMajor()
          The major version number
 int getMinor()
          The minor version number
 int getPatch()
          The patch version number
 int hashCode()
           
 boolean isNewer(Version v)
          Checks if this version is newer than the supplied version.
 boolean isOlder(Version v)
          Checks if this version is older than the supplied version.
 boolean isUndetermined()
          Checks whether the version is valid.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(int major,
               int minor,
               int build,
               int patch)
Creates a new version

Parameters:
major -
minor -
build -
patch -

Version

public Version(java.lang.String version)
Creates a version based on a string representation.

Parameters:
version -
Method Detail

getMinor

public int getMinor()
The minor version number


getMajor

public int getMajor()
The major version number


getBuild

public int getBuild()
The build version number


getPatch

public int getPatch()
The patch version number


isUndetermined

public boolean isUndetermined()
Checks whether the version is valid.


isNewer

public boolean isNewer(Version v)
Checks if this version is newer than the supplied version.

Parameters:
v -

isOlder

public boolean isOlder(Version v)
Checks if this version is older than the supplied version.

Parameters:
v -

getFullString

public java.lang.String getFullString()
Full string representation of the current version.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object