/** * This method extends the given condition with stop(until) condition if necessary. * The until condition needs to be applied only if both of the given conditions are not null. * * @param condition the condition to extend * @param untilCondition the until condition to join with the given condition * @param isTakeCondition whether the {@code condition} is for {@code TAKE} edge * @return condition with AND applied or the original condition */ private IterativeCondition<T> extendWithUntilCondition( IterativeCondition<T> condition, IterativeCondition<T> untilCondition, boolean isTakeCondition) { if (untilCondition != null && condition != null) { return new RichAndCondition<>(new RichNotCondition<>(untilCondition), condition); } else if (untilCondition != null && isTakeCondition) { return new RichNotCondition<>(untilCondition); } return condition; }
@Override public boolean filter(T value, Context<T> ctx) throws Exception { return !getNestedConditions()[0].filter(value, ctx); } }
private void updateWithGreedyCondition( State<T> state, IterativeCondition<T> takeCondition) { for (StateTransition<T> stateTransition : state.getStateTransitions()) { stateTransition.setCondition( new RichAndCondition<>(stateTransition.getCondition(), new RichNotCondition<>(takeCondition))); } } }
break; case SKIP_TILL_NEXT: innerIgnoreCondition = new RichNotCondition<>((IterativeCondition<T>) pattern.getCondition()); break; case SKIP_TILL_ANY:
notNext.addIgnore(lastSink, new RichNotCondition<>(notCondition)); } else { notNext.addProceed(lastSink, new RichNotCondition<>(notCondition));
? new RichAndCondition<>(proceedCondition, new RichNotCondition<>(untilCondition)) : proceedCondition); } else {
? new RichAndCondition<>(proceedCondition, new RichNotCondition<>(untilCondition)) : proceedCondition); updateWithGreedyCondition(sinkState, getTakeCondition(currentPattern));
break; case SKIP_TILL_NEXT: ignoreCondition = new RichNotCondition<>((IterativeCondition<T>) pattern.getCondition()); break; case SKIP_TILL_ANY: