Package org.biopax.paxtools.pattern
Class MappedConst
java.lang.Object
org.biopax.paxtools.pattern.MappedConst
- All Implemented Interfaces:
Constraint
This is a mapping from a constraint to the elements in a match.
- Author:
- Ozgun Babur
-
Constructor Summary
ConstructorsConstructorDescriptionMappedConst(Constraint constr, int... inds) Constructor with the constraint and the index mapping. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCan generate only if the wrapped constraint is generative.Calls generate method of the constraint with index translation.Getter for the constraint.int[]getInds()Getter for the mapped indices.intGets the maximum index.intGets variable size of the wrapped constraint.booleanDirects to satisfies method of the wrapped constraint with index translation.protected int[]translate(int[] outer) This methods translates the indexes of outer constraint, to this inner constraint.
-
Constructor Details
-
MappedConst
Constructor with the constraint and the index mapping.- Parameters:
constr- constraint to mapinds- mapped indexes
-
-
Method Details
-
getConstr
Getter for the constraint.- Returns:
- the wrapped constraint
-
getInds
public int[] getInds()Getter for the mapped indices.- Returns:
- mapped indices
-
getMaxInd
public int getMaxInd()Gets the maximum index.- Returns:
- maximum index
-
translate
protected int[] translate(int[] outer) This methods translates the indexes of outer constraint, to this inner constraint.- Parameters:
outer- mapped indices for the outer constraints- Returns:
- translated indices
-
canGenerate
public boolean canGenerate()Can generate only if the wrapped constraint is generative.- Specified by:
canGeneratein interfaceConstraint- Returns:
- if the wrapped constraint is generative
-
generate
Calls generate method of the constraint with index translation.- Specified by:
generatein interfaceConstraint- Parameters:
match- current pattern matchouter- untranslated indices- Returns:
- generated satisfying elements
-
satisfies
Directs to satisfies method of the wrapped constraint with index translation.- Specified by:
satisfiesin interfaceConstraint- Parameters:
match- current pattern matchouter- untranslated indices- Returns:
- true if the constraint is satisfied
-
getVariableSize
public int getVariableSize()Gets variable size of the wrapped constraint.- Specified by:
getVariableSizein interfaceConstraint- Returns:
- variable size of the wrapped constraint
-