openfuture.bugbase.model
Class VersionLabel

java.lang.Object
  |
  +--openfuture.bugbase.model.VersionLabel
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class VersionLabel
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Versions label with three levels: major version, minor version and build. Created: Tue Apr 25 20:52:08 2000

Version:
$Revision: 1.4 $
Author:
Wolfgang Reissenberger
See Also:
Serialized Form

Constructor Summary
VersionLabel()
          Constructs a version 0.0.0.
VersionLabel(java.lang.String version)
          Creates a new version and calls set(java.lang.String).
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares this with another object (total ordering).
 int getBuild()
          Get the value of build.
 int getMajorVersion()
          Get the value of majorVersion.
 int getMinorVersion()
          Get the value of minorVersion.
 java.lang.String getSuffix()
          Get the value of suffix.
 void set(java.lang.String version)
          Sets version number. version must be of the form "xx.yy.zz", where xx is the major version, yy the minor version and zz the build number.
 void setBuild(int v)
          Set the value of build.
 void setMajorVersion(int v)
          Set the value of majorVersion.
 void setMinorVersion(int v)
          Set the value of minorVersion.
 void setSuffix(java.lang.String v)
          Set the value of suffix.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionLabel

public VersionLabel()
Constructs a version 0.0.0.

VersionLabel

public VersionLabel(java.lang.String version)
Creates a new version and calls set(java.lang.String).
Parameters:
version - version number.
Throws:
java.lang.NumberFormatException - if xx, yy or zz are not integers.
Method Detail

getMajorVersion

public int getMajorVersion()
Get the value of majorVersion.
Returns:
Value of majorVersion.

setMajorVersion

public void setMajorVersion(int v)
Set the value of majorVersion.
Parameters:
v - Value to assign to majorVersion.

getMinorVersion

public int getMinorVersion()
Get the value of minorVersion.
Returns:
Value of minorVersion.

setMinorVersion

public void setMinorVersion(int v)
Set the value of minorVersion.
Parameters:
v - Value to assign to minorVersion.

getBuild

public int getBuild()
Get the value of build.
Returns:
Value of build.

setBuild

public void setBuild(int v)
Set the value of build.
Parameters:
v - Value to assign to build.

getSuffix

public java.lang.String getSuffix()
Get the value of suffix.
Returns:
value of suffix.

setSuffix

public void setSuffix(java.lang.String v)
Set the value of suffix.
Parameters:
v - Value to assign to suffix.

set

public void set(java.lang.String version)
Sets version number. version must be of the form "xx.yy.zz", where xx is the major version, yy the minor version and zz the build number.
Parameters:
version - version number.
Throws:
java.lang.NumberFormatException - if xx, yy or zz are not integers.

toString

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

compareTo

public int compareTo(java.lang.Object other)
Compares this with another object (total ordering).
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - object to compare with
Returns:
1, if other is less than this or null, 0 if equal, -1 otherwise.
Throws:
java.lang.IllegalArgumentException - if other is not an instance of Version


Copyright © 2000 -- 2003 openfuture.de. All Rights Reserved.