Class OR
java.lang.Object
org.biopax.paxtools.pattern.constraint.ConstraintAdapter
org.biopax.paxtools.pattern.constraint.OR
- All Implemented Interfaces:
Constraint
- Direct Known Subclasses:
AND,MultiPathConstraint,XOR
Logical OR of several constraints. Each constraint should have the same variable size and should
be able to process same variables at the same order. Constraints should be all generative or all
non-generative, and they cannot mix.
- Author:
- Ozgun Babur
-
Field Summary
Fields inherited from class org.biopax.paxtools.pattern.constraint.ConstraintAdapter
blacklist, size -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCan generate only if all of the wrapped constraints are generative.Gets the intersection of the generated values of wrapped constraints.intChecks the inner mapping of the wrapped constraints and figures the size.protected intmax(int[] v) Gets the max value.booleanChecks if any of the wrapped constraints satisfy.Methods inherited from class org.biopax.paxtools.pattern.constraint.ConstraintAdapter
assertIndLength, convertStepDirection, findDirectionInCatalysis, findDirectionInPathways, getCatalysisDirection, getControlChain, getConvParticipants, getDirection, getDirection, getDirection, getDirection, setSize
-
Constructor Details
-
OR
Constructor with the array of mapped constraints.- Parameters:
con- wrapped constraints
-
-
Method Details
-
satisfies
Checks if any of the wrapped constraints satisfy.- Specified by:
satisfiesin interfaceConstraint- Overrides:
satisfiesin classConstraintAdapter- Parameters:
match- current pattern matchind- mapped indices- Returns:
- true if any of the wrapped constraints satisfy
-
canGenerate
public boolean canGenerate()Can generate only if all of the wrapped constraints are generative.- Specified by:
canGeneratein interfaceConstraint- Overrides:
canGeneratein classConstraintAdapter- Returns:
- true if none of the wrapped constraints are non-generative
-
getVariableSize
public int getVariableSize()Checks the inner mapping of the wrapped constraints and figures the size.- Specified by:
getVariableSizein interfaceConstraint- Overrides:
getVariableSizein classConstraintAdapter- Returns:
- the size
-
max
protected int max(int[] v) Gets the max value.- Parameters:
v- array to check- Returns:
- max value
-
generate
Gets the intersection of the generated values of wrapped constraints.- Specified by:
generatein interfaceConstraint- Overrides:
generatein classConstraintAdapter- Parameters:
match- current pattern matchind- mapped indices- Returns:
- intersection of the generated values of wrapped constraints
-