}
}
else if (currentMethod == DatetimeMethodEnum.DURING || currentMethod == DatetimeMethodEnum.INCLUDES) {
// DURING: b.startTimestamp < a.startTimestamp <= a.endTimestamp < b.endTimestamp
// INCLUDES: a.startTimestamp < b.startTimestamp <= b.endTimestamp < a.endTimestamp
RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.DURING ? RelationalOpEnum.LT : RelationalOpEnum.GT;
queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
targetStreamNum, targetStartProp, targetStartExpr,
relop);
queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr,
relop);
}
else if (currentMethod == DatetimeMethodEnum.FINISHES || currentMethod == DatetimeMethodEnum.FINISHEDBY) {
// FINISHES: b.startTimestamp < a.startTimestamp and a.endTimestamp = b.endTimestamp
// FINISHEDBY: a.startTimestamp < b.startTimestamp and a.endTimestamp = b.endTimestamp
RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.FINISHES ? RelationalOpEnum.LT : RelationalOpEnum.GT;
queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
targetStreamNum, targetStartProp, targetStartExpr,
relop);
queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr);
}
else if (currentMethod == DatetimeMethodEnum.MEETS) {
// a.endTimestamp = b.startTimestamp
queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
parameterStreamNum, parameterStartProp, parameterStartExpr);
}
else if (currentMethod == DatetimeMethodEnum.METBY) {
// a.startTimestamp = b.endTimestamp
queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr);
}
else if (currentMethod == DatetimeMethodEnum.OVERLAPS || currentMethod == DatetimeMethodEnum.OVERLAPPEDBY) {
// OVERLAPS: a.startTimestamp < b.startTimestamp < a.endTimestamp < b.endTimestamp
// OVERLAPPEDBY: b.startTimestamp < a.startTimestamp < b.endTimestamp < a.endTimestamp
RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.OVERLAPS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
parameterStreamNum, parameterStartProp, parameterStartExpr,
relop);
queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr,
relop);
if (currentMethod == DatetimeMethodEnum.OVERLAPS) {
queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
targetStreamNum, targetEndProp, targetEndExpr,
RelationalOpEnum.LT);
}
else {
queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr,
RelationalOpEnum.LT);
}
}
else if (currentMethod == DatetimeMethodEnum.STARTS || currentMethod == DatetimeMethodEnum.STARTEDBY) {
// STARTS: a.startTimestamp = b.startTimestamp and a.endTimestamp < b.endTimestamp
// STARTEDBY: a.startTimestamp = b.startTimestamp and b.endTimestamp < a.endTimestamp
queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
parameterStreamNum, parameterStartProp, parameterStartExpr);
RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.STARTS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr,
relop);
}
}