org.apache.avalon.framework
Class Version
java.lang.Object
|
+--org.apache.avalon.framework.Version
- public final class Version
- extends java.lang.Object
This class is used to hold version information pertaining to a Component or interface.
The version number of a Component
is made up of three
dot-separated fields:
"major.minor.patchlevel"
The major, minor and patchlevel fields are
integer numbers represented in decimal notation and have the
following meaning:
- major - When the major version changes (in ex. from
"1.5.12" to "2.0.0"), then backward compatibility
with previous releases is not granted.
- minor - When the minor version changes (in ex. from
"1.5.12" to "1.6.0"), then backward compatibility
with previous releases is granted, but something changed in the
implementation of the Component. (ie it methods could have been added)
- patchlevel - When the patchlevel version changes (in ex.
from "1.5.12" to "1.5.13"), then the the changes are
small forward compatible bug fixes or documentation modifications etc.
- Author:
- Federico Barbieri, Pierpaolo Fumagalli, Stefano Mazzocchi, Roberto Lo Giacco, Peter Donald
Constructor Summary |
Version(int major,
int minor,
int revision)
Create a new instance of a Version object with the
specified version numbers. |
Method Summary |
boolean |
complies(Version other)
Check this Version against another for compliancy
(compatibility). |
boolean |
equals(Version other)
Check this Version against another for equality. |
java.lang.String |
toString()
Overload toString to report version correctly. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Version
public Version(int major,
int minor,
int revision)
- Create a new instance of a
Version
object with the
specified version numbers.
- Parameters:
major
- This Version
major number.minor
- This Version
minor number.rev
- This Version
revision number.
equals
public boolean equals(Version other)
- Check this
Version
against another for equality.
If this Version
is compatible with the specified one, then
true is returned, otherwise false.
- Parameters:
other
- The other Version
object to be compared with this
for equality.
complies
public boolean complies(Version other)
- Check this
Version
against another for compliancy
(compatibility).
If this Version
is compatible with the specified one, then
true is returned, otherwise false. Be careful when using
this method since, in example, version 1.3.7 is compliant to version
1.3.6, while the opposite is not.
- Parameters:
v
- The other Version
object to be compared with this
for compliancy (compatibility).
toString
public java.lang.String toString()
- Overload toString to report version correctly.
- Overrides:
toString
in class java.lang.Object
- Returns:
- the dot seperated version string
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.