Package weka.core.packageManagement
Class PackageConstraint
java.lang.Object
weka.core.packageManagement.PackageConstraint
- Direct Known Subclasses:
VersionPackageConstraint
,VersionRangePackageConstraint
Abstract base class for package constraints. An example implementation
might be to encapsulate a constraint with respect to a version
number. Checking against a target in this case would
typically assume the same package for both this and the target.
- Version:
- $Revision: 44030 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
checkConstraint
(Package target) Check the target package against the constraint embodied in this PackageConstraint.abstract PackageConstraint
checkConstraint
(PackageConstraint target) Check the target package constraint against the constraint embodied in this package constraint.Get the package that this constraint applies to.void
Set the package that this constraint applies to.
-
Constructor Details
-
PackageConstraint
public PackageConstraint()
-
-
Method Details
-
setPackage
Set the package that this constraint applies to.- Parameters:
p
- the package that this constraint applies to.
-
getPackage
Get the package that this constraint applies to.- Returns:
- the Package that this constraint applies to.
-
checkConstraint
Check the target package against the constraint embodied in this PackageConstraint.- 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.
-
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.- 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
-