Package weka.core.packageManagement
Class VersionPackageConstraint
java.lang.Object
weka.core.packageManagement.PackageConstraint
weka.core.packageManagement.VersionPackageConstraint
Concrete implementation of PackageConstraint that encapsulates constraints
related to version numbers. Handles equality = and open-ended inequalities
(e.g. > x, < x, >= x, <= x).
- Version:
- $Revision: 51469 $
- Author:
- mhall (mhall{[at]}pentaho{[dot]}com)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration encapsulating version comparison operations -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkConstraint
(Package target) Check the target package against the constraint embodied in this PackageConstraint.checkConstraint
(PackageConstraint target) Check the target package constraint against the constraint embodied in this package constraint.Returns a VersionComparison that represents the comparison between the supplied version 1 and version 2.void
setVersionConstraint
(String constraint) void
toString()
Methods inherited from class weka.core.packageManagement.PackageConstraint
getPackage, setPackage
-
Field Details
-
VERSION_KEY
The meta data key for the version number
-
-
Constructor Details
-
VersionPackageConstraint
-
-
Method Details
-
compare
Returns a VersionComparison that represents the comparison between the supplied version 1 and version 2.- Parameters:
version1
- String containing version number 1.version2
- String containing version number 2.- Returns:
- a VersionComparison object.
-
setVersionConstraint
-
getVersionComparison
-
setVersionConstraint
-
checkConstraint
Check the target package constraint against the constraint embodied in this package constraint. Returns either the package constraint that covers both this and the target constraint, or null if this and the target are incompatible. Try and return the *least* restrictive constraint that satisfies this and the target.- Specified by:
checkConstraint
in classPackageConstraint
- Parameters:
target
- the package constraint to compare against- Returns:
- a package constraint that covers this and the supplied constraint, or null if they are incompatible.
- Throws:
Exception
-
checkConstraint
Check the target package against the constraint embodied in this PackageConstraint.- Specified by:
checkConstraint
in classPackageConstraint
- Parameters:
target
- a package to check with respect to the encapsulated package and the constraint.- Returns:
- true if the constraint is met by the target package with respect to the encapsulated package + constraint.
- Throws:
Exception
- if the constraint can't be checked for some reason.
-
toString
-