Package org.intermine.api.query.range
Class ConstraintOptions
- java.lang.Object
-
- org.intermine.api.query.range.ConstraintOptions
-
public class ConstraintOptions extends java.lang.Object
A bundle of options consumed by the AbstractHelper when generating constraint sets for a set of ranges. A class inheriting from AbstractHelper need only provide a definition for how to build a WITHIN constraint for a set of ranges as a set of constraint options, and the other constraint option sets can be derived.- Author:
- Alex Kalderimis
-
-
Constructor Summary
Constructors Constructor Description ConstraintOptions(ConstraintOp mainOp, ConstraintOp rangeOp, ConstraintOp leftOp, ConstraintOp rightOp)
Construct a new set of constraint options.ConstraintOptions(ConstraintOp mainOp, ConstraintOp rangeOp, ConstraintOp leftOp, ConstraintOp rightOp, java.lang.String leftField, java.lang.String rightField)
Construct a new set of constraint options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLeftField()
Defaults to "start".ConstraintOp
getLeftOp()
ConstraintOp
getMainSetOp()
ConstraintOp
getRangeSetOp()
java.lang.String
getRightField()
Defaults to "end".ConstraintOp
getRightOp()
ConstraintOptions
negate()
Return a new constraint set with each ConstraintOp negated.ConstraintOptions
negateAndSwap()
Return a new constraint set with each ConstraintOp negated, and the left and right fields swapped.
-
-
-
Constructor Detail
-
ConstraintOptions
public ConstraintOptions(ConstraintOp mainOp, ConstraintOp rangeOp, ConstraintOp leftOp, ConstraintOp rightOp)
Construct a new set of constraint options.- Parameters:
mainOp
- The logical operator to use to combine constraints for ranges together. Expected to be AND or ORrangeOp
- The logical operator to use to combine left and right constraints together for each range.leftOp
- The operator to use in the left side constraint.rightOp
- The operator to use in the right side constraint.
-
ConstraintOptions
public ConstraintOptions(ConstraintOp mainOp, ConstraintOp rangeOp, ConstraintOp leftOp, ConstraintOp rightOp, java.lang.String leftField, java.lang.String rightField)
Construct a new set of constraint options.- Parameters:
mainOp
- The logical operator to use to combine constraints for ranges together. Expected to be AND or ORrangeOp
- The logical operator to use to combine left and right constraints together for each range.leftOp
- The operator to use in the left side constraint.rightOp
- The operator to use in the right side constraint.leftField
- The field of the QueryNode to evaluate in the left side constraint.rightField
- The field of the QueryNode to evaluate in the right side constraint.
-
-
Method Detail
-
getMainSetOp
public ConstraintOp getMainSetOp()
- Returns:
- The logical operator to use to combine constraints for ranges together.
-
getRangeSetOp
public ConstraintOp getRangeSetOp()
- Returns:
- The logical operator to use to combine left and right constraints together for each range.
-
getLeftOp
public ConstraintOp getLeftOp()
- Returns:
- The operator to use in the left side constraint.
-
getRightOp
public ConstraintOp getRightOp()
- Returns:
- The operator to use in the right side constraint.
-
getLeftField
public java.lang.String getLeftField()
Defaults to "start".- Returns:
- The field of the QueryNode to evaluate in the left side constraint.
-
getRightField
public java.lang.String getRightField()
Defaults to "end".- Returns:
- The field of the QueryNode to evaluate in the right side constraint.
-
negate
public ConstraintOptions negate()
Return a new constraint set with each ConstraintOp negated.- Returns:
- A negated version of this constraint set.
-
negateAndSwap
public ConstraintOptions negateAndSwap()
Return a new constraint set with each ConstraintOp negated, and the left and right fields swapped.- Returns:
- A negated and swapped version of this constraint set.
-
-