@Override public boolean filter(T value, Context<T> ctx) throws Exception { return !getNestedConditions()[0].filter(value, ctx); } }
@Override public boolean filter(T value, Context<T> ctx) throws Exception { return original != null && !original.filter(value, ctx); } }
public IterativeCondition<F> getCondition() { if (condition != null) { return condition; } else { return BooleanConditions.trueFunction(); } }
@Override public boolean filter(T value, Context<T> ctx) throws Exception { return filter(value); } }
/** * 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; }
/** * @return One of the {@link IterativeCondition conditions} combined in this condition. */ public IterativeCondition<T> getLeft() { return getNestedConditions()[0]; }
/** * @return One of the {@link IterativeCondition conditions} combined in this condition. */ public IterativeCondition<T> getLeft() { return getNestedConditions()[0]; }
@Override public boolean filter(Event value, Context<Event> ctx) throws Exception { return ctx.timestamp() == timestamp; } });
@Override public boolean filter(Event value, Context<Event> ctx) throws Exception { return ctx.currentProcessingTime() == 3; } });
@Override public void close() throws Exception { super.close(); for (IterativeCondition<T> nestedCondition : nestedConditions) { FunctionUtils.closeFunction(nestedCondition); } } }
@Override public void setRuntimeContext(RuntimeContext t) { super.setRuntimeContext(t); for (IterativeCondition<T> nestedCondition : nestedConditions) { FunctionUtils.setFunctionRuntimeContext(nestedCondition, t); } }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); for (IterativeCondition<T> nestedCondition : nestedConditions) { FunctionUtils.openFunction(nestedCondition, parameters); } }
private boolean checkFilterCondition( ConditionContext context, IterativeCondition<T> condition, T event) throws Exception { return condition == null || condition.filter(event, context); }
private void updateWithGreedyCondition( State<T> state, IterativeCondition<T> takeCondition) { for (StateTransition<T> stateTransition : state.getStateTransitions()) { stateTransition.setCondition( new RichAndCondition<>(stateTransition.getCondition(), new RichNotCondition<>(takeCondition))); } } }
/** * @return One of the {@link IterativeCondition conditions} combined in this condition. */ public IterativeCondition<T> getRight() { return getNestedConditions()[1]; } }
/** * @return One of the {@link IterativeCondition conditions} combined in this condition. */ public IterativeCondition<T> getRight() { return getNestedConditions()[1]; } }