public static Within within(Expression pattern) { return new Within(pattern); }
@Override public int hashCode() { int result = operator.hashCode(); result = 31 * result + (durations != null ? durations.hashCode() : 0); return result; }
@Override public int hashCode() { int result = within != null ? within.hashCode() : 0; result = 31 * result + (per != null ? per.hashCode() : 0); return result; }
/** * Generates AggregateByTimePeriod object with the given Siddhi TimePeriod * @param timePeriod Siddhi TimePeriod object * @return AggregateByTimePeriod object * @throws DesignGenerationException Unknown type of TimePeriod operator */ private AggregateByTimePeriod generateAggregateByTime(TimePeriod timePeriod) throws DesignGenerationException { preserveCodeSegment(timePeriod); if (("INTERVAL").equalsIgnoreCase(timePeriod.getOperator().toString())) { return generateAggregateByTimeInterval(timePeriod.getDurations()); } else if (("RANGE").equalsIgnoreCase(timePeriod.getOperator().toString())) { return generateAggregateByTimeRange(timePeriod.getDurations()); } throw new DesignGenerationException("Unable to generate AggregateByTime for TimePeriod of type unknown"); }
public static TimePeriod interval(Duration... durations) { // interval sec, min, time TimePeriod timePeriod = new TimePeriod(Operator.INTERVAL); Collections.addAll(timePeriod.durations, durations); return timePeriod; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JoinInputStream that = (JoinInputStream) o; if (leftInputStream != null ? !leftInputStream.equals(that.leftInputStream) : that.leftInputStream != null) { return false; } if (type != that.type) { return false; } if (rightInputStream != null ? !rightInputStream.equals(that.rightInputStream) : that.rightInputStream != null) { return false; } if (onCompare != null ? !onCompare.equals(that.onCompare) : that.onCompare != null) { return false; } if (trigger != that.trigger) { return false; } if (within != null ? !within.equals(that.within) : that.within != null) { return false; } return per != null ? per.equals(that.per) : that.per == null; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + basicSingleInputStream.hashCode(); result = 31 * result + (selector != null ? selector.hashCode() : 0); result = 31 * result + aggregateAttribute.hashCode(); result = 31 * result + (timePeriod != null ? timePeriod.hashCode() : 0); result = 31 * result + (annotations != null ? annotations.hashCode() : 0); return result; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } AggregationDefinition that = (AggregationDefinition) o; if (!basicSingleInputStream.equals(that.basicSingleInputStream)) { return false; } if (selector != null ? !selector.equals(that.selector) : that.selector != null) { return false; } if (!aggregateAttribute.equals(that.aggregateAttribute)) { return false; } if (timePeriod != null ? !timePeriod.equals(that.timePeriod) : that.timePeriod != null) { return false; } return annotations != null ? annotations.equals(that.annotations) : that.annotations == null; }
@Override public Object visitWithin_time_range(SiddhiQLParser.Within_time_rangeContext ctx) { Within within; if (ctx.end_pattern == null) { within = Within.within((Expression) visit(ctx.start_pattern)); } else { within = Within.within((Expression) visit(ctx.start_pattern), (Expression) visit(ctx.end_pattern)); } populateQueryContext(within, ctx); return within; }
public static Within within(Expression start, Expression end) { return new Within(start, end); }
public static TimePeriod range(Duration begging, Duration end) { // range sec ... min TimePeriod timePeriod = new TimePeriod(Operator.RANGE); timePeriod.durations.add(begging); timePeriod.durations.add(end); return timePeriod; }
@Override public int hashCode() { int result = leftInputStream != null ? leftInputStream.hashCode() : 0; result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (rightInputStream != null ? rightInputStream.hashCode() : 0); result = 31 * result + (onCompare != null ? onCompare.hashCode() : 0); result = 31 * result + (trigger != null ? trigger.hashCode() : 0); result = 31 * result + (within != null ? within.hashCode() : 0); result = 31 * result + (per != null ? per.hashCode() : 0); return result; }
@Override public int hashCode() { int result = operator.hashCode(); result = 31 * result + (durations != null ? durations.hashCode() : 0); return result; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AggregationInputStore that = (AggregationInputStore) o; if (within != null ? !within.equals(that.within) : that.within != null) { return false; } if (onCondition != null ? !onCondition.equals(that.onCondition) : that.onCondition != null) { return false; } if (store != null ? !store.equals(that.store) : that.store != null) { return false; } return per != null ? per.equals(that.per) : that.per == null; }
public static Within within(Expression pattern) { return new Within(pattern); }
public static TimePeriod interval(Duration... durations) { // interval sec, min, time TimePeriod timePeriod = new TimePeriod(Operator.INTERVAL); Collections.addAll(timePeriod.durations, durations); return timePeriod; }
@Override public int hashCode() { int result = within != null ? within.hashCode() : 0; result = 31 * result + (per != null ? per.hashCode() : 0); return result; }
public static Within within(Expression start, Expression end) { return new Within(start, end); }
public static TimePeriod range(Duration begging, Duration end) { // range sec ... min TimePeriod timePeriod = new TimePeriod(Operator.RANGE); timePeriod.durations.add(begging); timePeriod.durations.add(end); return timePeriod; }
@Override public int hashCode() { int result = leftInputStream != null ? leftInputStream.hashCode() : 0; result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (rightInputStream != null ? rightInputStream.hashCode() : 0); result = 31 * result + (onCompare != null ? onCompare.hashCode() : 0); result = 31 * result + (trigger != null ? trigger.hashCode() : 0); result = 31 * result + (within != null ? within.hashCode() : 0); result = 31 * result + (per != null ? per.hashCode() : 0); return result; }