com.resilientedge.util
Class VersionInfo

java.lang.Object
  |
  +--com.resilientedge.util.VersionInfo
All Implemented Interfaces:
java.io.Serializable

public class VersionInfo
extends java.lang.Object
implements java.io.Serializable

Describes a versioned item and provides convienance methods for testing compatibility between versions.

Version:
$Revision: 1.1.1.1 $
Author:
jwh
See Also:
Serialized Form

Constructor Summary
VersionInfo()
           
 
Method Summary
 boolean equals(java.lang.Object target)
          Returns true if target is an instance of Version info, and if the major, minor, micro, and patch levels match.
 void fromStrings(java.lang.String major, java.lang.String minor, java.lang.String micro, java.lang.String patch, java.lang.String buildNum, java.lang.String date)
          Description of the Method
 java.lang.String getBuildDate()
          Get the value of buildDate.
 int getBuildNumber()
          Get the value of buildNumber.
 int getMajorVersion()
          Get the value of majorVersion.
 int getMicroVersion()
          Get the value of microVersion.
 int getMinorVersion()
          Get the value of minorVersion.
 java.lang.String getPatchLevel()
          Get the value of patchLevel.
 boolean greaterThan(VersionInfo targetInfo)
          Returns true if this instance is greater than the target
 boolean lessThan(VersionInfo targetInfo)
          Returns true if this instance is less than the target
 void setBuildDate(java.lang.String v)
          Set the value of buildDate.
 void setBuildNumber(int v)
          Set the value of buildNumber.
 void setMajorVersion(int v)
          Set the value of majorVersion.
 void setMicroVersion(int v)
          Set the value of microVersion.
 void setMinorVersion(int v)
          Set the value of minorVersion.
 void setPatchLevel(java.lang.String v)
          Set the value of patchLevel.
 java.lang.String toString()
          Returns a string version of the instance that includes all fields in the format:
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionInfo

public VersionInfo()
Method Detail

setMajorVersion

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

setMinorVersion

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

setMicroVersion

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

setPatchLevel

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

setBuildNumber

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

setBuildDate

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

getMajorVersion

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

getMinorVersion

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

getMicroVersion

public int getMicroVersion()
Get the value of microVersion.
Returns:
value of microVersion.

getPatchLevel

public java.lang.String getPatchLevel()
Get the value of patchLevel.
Returns:
value of patchLevel.

getBuildNumber

public int getBuildNumber()
Get the value of buildNumber.
Returns:
value of buildNumber.

getBuildDate

public java.lang.String getBuildDate()
Get the value of buildDate.
Returns:
value of buildDate.

toString

public java.lang.String toString()
Returns a string version of the instance that includes all fields in the format:

<major>.<minor>.<micro><patch> Build <buildnum> <builddate>

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this instance

lessThan

public boolean lessThan(VersionInfo targetInfo)
Returns true if this instance is less than the target
Parameters:
targetInfo - the target version info
Returns:
true if this instance is less than the target

greaterThan

public boolean greaterThan(VersionInfo targetInfo)
Returns true if this instance is greater than the target
Parameters:
targetInfo - the target version info
Returns:
true if this instance is greater than the target

equals

public boolean equals(java.lang.Object target)
Returns true if target is an instance of Version info, and if the major, minor, micro, and patch levels match.
Overrides:
equals in class java.lang.Object
Parameters:
target - the version instance to compare to this one
Returns:
true if the instances are equal.

fromStrings

public void fromStrings(java.lang.String major,
                        java.lang.String minor,
                        java.lang.String micro,
                        java.lang.String patch,
                        java.lang.String buildNum,
                        java.lang.String date)
Description of the Method
Parameters:
major - Description of Parameter
minor - Description of Parameter
micro - Description of Parameter
patch - Description of Parameter
buildNum - Description of Parameter
date - Description of Parameter


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.