Class FieldOfMultiple
java.lang.Object
org.biopax.paxtools.pattern.constraint.ConstraintAdapter
org.biopax.paxtools.pattern.constraint.Field
org.biopax.paxtools.pattern.constraint.FieldOfMultiple
- All Implemented Interfaces:
Constraint
Checks if generated elements has or has not a specific value for a field, or the field value of
another set of generated elements.
- Author:
- Ozgun Babur
-
Nested Class Summary
Nested classes/interfaces inherited from class org.biopax.paxtools.pattern.constraint.Field
Field.Operation -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MappedConstGenerative constraint for first group of generated elements, to use on first mapped element.protected MappedConstGenerative constraint for second group of generated elements, to use on second mapped element.Fields inherited from class org.biopax.paxtools.pattern.constraint.Field
EMPTY, USE_SECOND_ARGFields inherited from class org.biopax.paxtools.pattern.constraint.ConstraintAdapter
blacklist, size -
Constructor Summary
ConstructorsConstructorDescriptionFieldOfMultiple(MappedConst con, String accessorString, Field.Operation oper, Object value) Constructor with accessor string for the field value of the element and the desired value.FieldOfMultiple(MappedConst con1, String accessorString1, MappedConst con2, String accessorString2, Field.Operation oper) Constructor with accessor strings for the field value of the element and the desired value that will be reached from the second element. -
Method Summary
Modifier and TypeMethodDescriptionintSize of this constraint is one less than con1 if con2 is null, otherwise it is two less than the total of size of con1 and con2.booleanChecks if the generated elements from the first mapped element has either the desired value, or has some value in common with the elements generated from second mapped element.Methods inherited from class org.biopax.paxtools.pattern.constraint.ConstraintAdapter
assertIndLength, canGenerate, convertStepDirection, findDirectionInCatalysis, findDirectionInPathways, generate, getCatalysisDirection, getControlChain, getConvParticipants, getDirection, getDirection, getDirection, getDirection, setSize
-
Field Details
-
con1
Generative constraint for first group of generated elements, to use on first mapped element. -
con2
Generative constraint for second group of generated elements, to use on second mapped element.
-
-
Constructor Details
-
FieldOfMultiple
Constructor with accessor string for the field value of the element and the desired value. If the desired value is EMPTY, then emptiness is checked. If it is USE_SECOND_ARG, then the second mapped element is used as the desired value. If a filed of the second element is desired then the other constructor should be used.- Parameters:
con- the generative constraint of size 2 whose generated values will be checkedaccessorString- accessor string for the elementoper- operationvalue- desired value
-
FieldOfMultiple
public FieldOfMultiple(MappedConst con1, String accessorString1, MappedConst con2, String accessorString2, Field.Operation oper) Constructor with accessor strings for the field value of the element and the desired value that will be reached from the second element.- Parameters:
con1- the generative constraint of size 2 for the first group of elementsaccessorString1- accessor string for the first elementcon2- the generative constraint of size 2 for the second group of elementsaccessorString2- accessor string for the second elementoper- operation
-
-
Method Details
-
getVariableSize
public int getVariableSize()Size of this constraint is one less than con1 if con2 is null, otherwise it is two less than the total of size of con1 and con2.- Specified by:
getVariableSizein interfaceConstraint- Overrides:
getVariableSizein classConstraintAdapter- Returns:
- the size based on con1 and con2
-
satisfies
Checks if the generated elements from the first mapped element has either the desired value, or has some value in common with the elements generated from second mapped element.- Specified by:
satisfiesin interfaceConstraint- Overrides:
satisfiesin classField- Parameters:
match- current pattern matchind- mapped indices- Returns:
- true if a value match is found
-