com.teraspaces.qwframework
Class Version

java.lang.Object
  extended by com.teraspaces.qwframework.Version
All Implemented Interfaces:
Comparable<Version>

public final class Version
extends Object
implements Comparable<Version>

A Java implementation of .Net Version class.


Constructor Summary
Version()
          Instantiates a new version.
Version(int major, int minor)
          Instantiates a new version.
Version(int major, int minor, int build)
          Instantiates a new version.
Version(int major, int minor, int build, int revision)
          Instantiates a new version.
Version(String version)
          Instantiates a new version.
 
Method Summary
 int compareTo(Version v)
           
 boolean equals(Object obj)
           
 boolean equals(Version x)
          Equals.
 int getBuild()
          Gets the builds the.
 int getMajor()
          Gets the major.
 short getMajorRevision()
          Gets the major revision.
 int getMinor()
          Gets the minor.
 short getMinorRevision()
          Gets the minor revision.
 int getRevision()
          Gets the revision.
 int hashCode()
           
 String toString()
           
 String ToString(int fields)
          Converts current instance into a string.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version()
Instantiates a new version.


Version

public Version(String version)
Instantiates a new version.

Parameters:
version - the version

Version

public Version(int major,
               int minor)
Instantiates a new version.

Parameters:
major - the major
minor - the minor

Version

public Version(int major,
               int minor,
               int build)
Instantiates a new version.

Parameters:
major - the major
minor - the minor
build - the build

Version

public Version(int major,
               int minor,
               int build,
               int revision)
Instantiates a new version.

Parameters:
major - the major
minor - the minor
build - the build
revision - the revision
Method Detail

getBuild

public int getBuild()
Gets the builds the.

Returns:
the builds the

getMajor

public int getMajor()
Gets the major.

Returns:
the major

getMinor

public int getMinor()
Gets the minor.

Returns:
the minor

getRevision

public int getRevision()
Gets the revision.

Returns:
the revision

getMajorRevision

public short getMajorRevision()
Gets the major revision.

Returns:
the major revision

getMinorRevision

public short getMinorRevision()
Gets the minor revision.

Returns:
the minor revision

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equals

public boolean equals(Version x)
Equals.

Parameters:
x - the x
Returns:
true, if successful

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

ToString

public String ToString(int fields)
Converts current instance into a string.

Parameters:
fields - the number of fields
Returns:
the result

compareTo

public int compareTo(Version v)
Specified by:
compareTo in interface Comparable<Version>