com.securitycentric.metacoretex.lib
Class Version

java.lang.Object
  extended bycom.securitycentric.metacoretex.lib.Version

public class Version
extends java.lang.Object

The Version object can be used by Probes to quickly determine if a version is greater or less than itself.

Author:
visigoth

Constructor Summary
Version(java.lang.String verStr)
          Creates a new instance of Version by parsing the specified string for a versionish segment of numbers seperated by [._]
 
Method Summary
 boolean isNewerThan(Version ver)
          Tests to see if this version is newer than the specified version object (non-Inclusive).
 boolean isOlderThan(Version ver)
          Tests to see if this version is older than the specified version object (non-Inclusive).
 java.lang.String toString()
          Returns the string representation of this version in dot notation.
 int verCount()
          Returns the number of indices in the version string.
 int verInt(int index)
          Returns the integer value of the specified index in the underlying version string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(java.lang.String verStr)
        throws VersionException
Creates a new instance of Version by parsing the specified string for a versionish segment of numbers seperated by [._]

Parameters:
verStr - String representation of the version (ie. 1.354.3_3)
Throws:
VersionException - VersionException is thrown if specified string for constructor cannot be parsed to find a version string.
Method Detail

isNewerThan

public boolean isNewerThan(Version ver)
Tests to see if this version is newer than the specified version object (non-Inclusive).

Parameters:
ver - Version object to compare to
Returns:
boolean true if ver is newer than this probe. False if not

isOlderThan

public boolean isOlderThan(Version ver)
Tests to see if this version is older than the specified version object (non-Inclusive).


verInt

public int verInt(int index)
Returns the integer value of the specified index in the underlying version string. ie. the verInt(3) for the version 3.145.42.4_3 would be 42.


verCount

public int verCount()
Returns the number of indices in the version string. ie. 4.24.64_2 would return 4


toString

public java.lang.String toString()
Returns the string representation of this version in dot notation.