com.bmc.mainview
Class VersionNumber

java.lang.Object
  extended by com.bmc.mainview.VersionNumber
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<VersionNumber>

public final class VersionNumber
extends java.lang.Object
implements java.lang.Comparable<VersionNumber>, java.io.Serializable

Stores a version number of the form 1.1.00

See Also:
Serialized Form

Constructor Summary
VersionNumber(int major, int minor, int sub)
          Constructs a new VersionNumber given integer values for the sections of the number.
VersionNumber(java.lang.String input)
          Constructs a new VersionNumber from a String which ends in a version number of the form n1.n2.n3, where n1 is the major version number, n2 is the minor version number and n3 is the sub-version or modification level.
 
Method Summary
 int compareTo(VersionNumber v)
          Compares this VersionNumber with the specified VersionNumber for order.
 boolean equals(java.lang.Object o)
          Compares this Object to the specified Object.
 boolean equals(VersionNumber v)
          Compares this VersionNumber to the specified VersionNumber.
 int getMajor()
           
 int getMinor()
           
 int getSub()
           
 int hashCode()
          Returns a hash code value for the Version number.
 void setMajor(int v)
           
 void setMinor(int v)
           
 void setSub(int v)
           
 java.lang.String toString()
          Returns the printable, dotted form of the version number.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionNumber

public VersionNumber(java.lang.String input)
              throws java.lang.IllegalArgumentException
Constructs a new VersionNumber from a String which ends in a version number of the form n1.n2.n3, where n1 is the major version number, n2 is the minor version number and n3 is the sub-version or modification level. Any characters in front of the version number are ignored.

Parameters:
input - The string to be parsed.
Throws:
java.lang.IllegalArgumentException

VersionNumber

public VersionNumber(int major,
                     int minor,
                     int sub)
Constructs a new VersionNumber given integer values for the sections of the number.

Parameters:
major -
minor -
sub -
Method Detail

getMajor

public int getMajor()

setMajor

public void setMajor(int v)

getMinor

public int getMinor()

setMinor

public void setMinor(int v)

getSub

public int getSub()

setSub

public void setSub(int v)

toString

public java.lang.String toString()
Returns the printable, dotted form of the version number. The sub-version number (last segment) is always at least two digits.

Overrides:
toString in class java.lang.Object
Returns:
A String of the form major.minor.sub

hashCode

public int hashCode()
Returns a hash code value for the Version number.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code for the string representation.
See Also:
Object.hashCode()

compareTo

public int compareTo(VersionNumber v)
Compares this VersionNumber with the specified VersionNumber for order. Returns a negative integer, zero, or a positive integer as this VersionNumber is less than, equal to, or greater than the specified VersionNumber.

Specified by:
compareTo in interface java.lang.Comparable<VersionNumber>
Parameters:
v - the VersionNumber to be compared.
Returns:
a negative integer, zero, or a positive integer as this VersionNumber is less than, equal to, or greater than the specified VersionNumber.

equals

public boolean equals(VersionNumber v)
Compares this VersionNumber to the specified VersionNumber. The result is true if and only if the argument is not null and has the same values as this VersionNumber.

Parameters:
v -
Returns:
true if both designate the same version.

equals

public boolean equals(java.lang.Object o)
Compares this Object to the specified Object. The result is true if and only if the argument is not null and has the same values as this Object.

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:
true if both designate the same version.