Package weka.core.packageManagement
Class VersionRangePackageConstraint
- java.lang.Object
-
- weka.core.packageManagement.PackageConstraint
-
- weka.core.packageManagement.VersionRangePackageConstraint
-
public class VersionRangePackageConstraint extends PackageConstraint
A concrete implementation of PackgageConstraint that encapsulates ranged version number constraints. Handles constraints of the form (u.v.w < package < x.y.z) and (package < u.v.w OR package > x.y.z)- Version:
- $Revision: 44030 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
-
Constructor Summary
Constructors Constructor Description VersionRangePackageConstraint(Package p)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckConstraint(Package target)Check the target package against the constraint embodied in this PackageConstraint.PackageConstraintcheckConstraint(PackageConstraint target)Check the target package constraint against the constraint embodied in this package constraint.java.lang.StringgetLowerBound()Get the lower bound of this rangeVersionPackageConstraint.VersionComparisongetLowerComparison()Get the lower comparisonjava.lang.StringgetUpperBound()Get the upper bound of this rangeVersionPackageConstraint.VersionComparisongetUpperComparison()Get the upper comparisonbooleanisBoundOR()Returns true if this is a bounded OR type of constraintvoidsetRangeConstraint(java.lang.String bound1, VersionPackageConstraint.VersionComparison comp1, java.lang.String bound2, VersionPackageConstraint.VersionComparison comp2)Set the range bounds and constraints.java.lang.StringtoString()-
Methods inherited from class weka.core.packageManagement.PackageConstraint
getPackage, setPackage
-
-
-
-
Constructor Detail
-
VersionRangePackageConstraint
public VersionRangePackageConstraint(Package p)
Constructor- Parameters:
p- the package to base this constraint on
-
-
Method Detail
-
setRangeConstraint
public void setRangeConstraint(java.lang.String bound1, VersionPackageConstraint.VersionComparison comp1, java.lang.String bound2, VersionPackageConstraint.VersionComparison comp2) throws java.lang.ExceptionSet the range bounds and constraints.- Parameters:
bound1- the first boundcomp1- the first comparisonbound2- the second boundcomp2- the second comparison- Throws:
java.lang.Exception- if the range constraint is malformed
-
getLowerBound
public java.lang.String getLowerBound()
Get the lower bound of this range- Returns:
- the lower bound
-
getUpperBound
public java.lang.String getUpperBound()
Get the upper bound of this range- Returns:
- the upper bound
-
getLowerComparison
public VersionPackageConstraint.VersionComparison getLowerComparison()
Get the lower comparison- Returns:
- the lower comparison
-
getUpperComparison
public VersionPackageConstraint.VersionComparison getUpperComparison()
Get the upper comparison- Returns:
- the upper comparison
-
isBoundOR
public boolean isBoundOR()
Returns true if this is a bounded OR type of constraint- Returns:
- true if this is a bounded OR type of constraint
-
checkConstraint
public boolean checkConstraint(Package target) throws java.lang.Exception
Check the target package against the constraint embodied in this PackageConstraint.- Specified by:
checkConstraintin 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:
java.lang.Exception- if the constraint can't be checked for some reason.
-
checkConstraint
public PackageConstraint checkConstraint(PackageConstraint target) throws java.lang.Exception
Description copied from class:PackageConstraintCheck 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.- Specified by:
checkConstraintin 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:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-