{
FeaturePath begin_fp = m_feat2path.get("begin");
FeaturePath end_fp = m_feat2path.get("end");
ConstraintFactory cf = jcas.getConstraintFactory();
FSIntConstraint bcLower = cf.createIntConstraint();
bcLower.geq(begin_lower);
FSMatchConstraint mcBegin = cf.embedConstraint(begin_fp, bcLower);
if (begin_upper > begin_lower) {
FSIntConstraint bcUpper = cf.createIntConstraint();
bcUpper.lt(begin_upper);
mcBegin = cf.and(mcBegin, cf.embedConstraint(begin_fp, bcUpper));
}
FSIntConstraint ecUpper = cf.createIntConstraint();
ecUpper.leq(end_upper);
FSMatchConstraint mcEnd = cf.embedConstraint(end_fp, ecUpper);
if (end_upper > end_lower) {
FSIntConstraint ecLower = cf.createIntConstraint();
ecLower.gt(end_lower);
mcEnd = cf.and(mcEnd, cf.embedConstraint(end_fp, ecLower));
}
FSMatchConstraint mcBounds = cf.and(mcBegin, mcEnd);
return mcBounds;