Package weka.core.packageManagement
Class PackageConstraint
- java.lang.Object
-
- weka.core.packageManagement.PackageConstraint
-
- Direct Known Subclasses:
VersionPackageConstraint,VersionRangePackageConstraint
public abstract class PackageConstraint extends java.lang.ObjectAbstract 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
Constructors Constructor Description PackageConstraint()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancheckConstraint(Package target)Check the target package against the constraint embodied in this PackageConstraint.abstract PackageConstraintcheckConstraint(PackageConstraint target)Check the target package constraint against the constraint embodied in this package constraint.PackagegetPackage()Get the package that this constraint applies to.voidsetPackage(Package p)Set the package that this constraint applies to.
-
-
-
Method Detail
-
setPackage
public void setPackage(Package p)
Set the package that this constraint applies to.- Parameters:
p- the package that this constraint applies to.
-
getPackage
public Package getPackage()
Get the package that this constraint applies to.- Returns:
- the Package that this constraint applies to.
-
checkConstraint
public abstract boolean checkConstraint(Package target) throws java.lang.Exception
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:
java.lang.Exception- if the constraint can't be checked for some reason.
-
checkConstraint
public abstract PackageConstraint checkConstraint(PackageConstraint target) throws java.lang.Exception
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:
java.lang.Exception
-
-