public OArrayConcatExpression copy() { OArrayConcatExpression result = new OArrayConcatExpression(-1); this.childExpressions.forEach(x -> result.childExpressions.add(x.copy())); return result; }
public Object execute(OIdentifiable iCurrentRecord, OCommandContext ctx) { Object result = childExpressions.get(0).execute(iCurrentRecord, ctx); for (int i = 1; i < childExpressions.size(); i++) { result = apply(result, childExpressions.get(i).execute(iCurrentRecord, ctx)); } return result; }
public void extractSubQueries(SubQueryCollector collector) { if (mathExpression != null) { mathExpression.extractSubQueries(collector); } if (arrayConcatExpression != null) { arrayConcatExpression.extractSubQueries(collector); } if (json != null) { json.extractSubQueries(collector); } }
final public OArrayConcatExpression ArrayConcatExpression() throws ParseException { OArrayConcatExpression jjtn000 = new OArrayConcatExpression(JJTARRAYCONCATEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));OArrayConcatExpressionElement sub; jjtn000.setChildExpressions(new java.util.ArrayList()); try { sub = ArrayConcatExpressionElement(); jjtn000.getChildExpressions().add(sub); label_23: while (true) { jj_consume_token(SC_OR); sub = ArrayConcatExpressionElement(); jjtn000.getChildExpressions().add(sub); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: jjtn000.jjtSetLastToken(getToken(0)); {if (true) return jjtn000;} } catch (Throwable jjte000) { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0));
public void deserialize(OResult fromResult) { singleQuotes = fromResult.getProperty("singleQuotes"); doubleQuotes = fromResult.getProperty("doubleQuotes"); isNull = fromResult.getProperty("isNull"); if (fromResult.getProperty("rid") != null) { rid = new ORid(-1); rid.deserialize(fromResult.getProperty("rid")); } if (fromResult.getProperty("mathExpression") != null) { mathExpression = OMathExpression.deserializeFromResult(fromResult.getProperty("mathExpression")); } if (fromResult.getProperty("arrayConcatExpression") != null) { arrayConcatExpression = new OArrayConcatExpression(-1); arrayConcatExpression.deserialize(fromResult.getProperty("arrayConcatExpression")); } if (fromResult.getProperty("json") != null) { json = new OJson(-1); json.deserialize(fromResult.getProperty("json")); } booleanValue = fromResult.getProperty("booleanValue"); }
return arrayConcatExpression.execute(iCurrentRecord, ctx); return ((OMathExpression) value).execute(iCurrentRecord, ctx); } else if (value instanceof OArrayConcatExpression) { return ((OArrayConcatExpression) value).execute(iCurrentRecord, ctx); } else if (value instanceof OJson) { return ((OJson) value).toMap(iCurrentRecord, ctx);
/** * if the condition involved the current pattern (MATCH statement, eg. $matched.something = foo), returns the name of involved * pattern aliases ("something" in this case) * * @return a list of pattern aliases involved in this condition. Null it does not involve the pattern */ List<String> getMatchPatternInvolvedAliases() { if (mathExpression != null) return mathExpression.getMatchPatternInvolvedAliases(); if (arrayConcatExpression != null) return arrayConcatExpression.getMatchPatternInvolvedAliases(); return null; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OExpression that = (OExpression) o; if (isNull != that.isNull) return false; if (singleQuotes != null ? !singleQuotes.equals(that.singleQuotes) : that.singleQuotes != null) return false; if (doubleQuotes != null ? !doubleQuotes.equals(that.doubleQuotes) : that.doubleQuotes != null) return false; if (rid != null ? !rid.equals(that.rid) : that.rid != null) return false; if (mathExpression != null ? !mathExpression.equals(that.mathExpression) : that.mathExpression != null) return false; if (arrayConcatExpression != null ? !arrayConcatExpression.equals(that.arrayConcatExpression) : that.arrayConcatExpression != null) return false; if (json != null ? !json.equals(that.json) : that.json != null) return false; if (booleanValue != null ? !booleanValue.equals(that.booleanValue) : that.booleanValue != null) return false; return true; }
public AggregationContext getAggregationContext(OCommandContext ctx) { if (mathExpression != null) { return mathExpression.getAggregationContext(ctx); } else if (arrayConcatExpression != null) { return arrayConcatExpression.getAggregationContext(ctx); } else { throw new OCommandExecutionException("Cannot aggregate on " + toString()); } }
public OExpression copy() { OExpression result = new OExpression(-1); result.singleQuotes = singleQuotes; result.doubleQuotes = doubleQuotes; result.isNull = isNull; result.rid = rid == null ? null : rid.copy(); result.mathExpression = mathExpression == null ? null : mathExpression.copy(); result.arrayConcatExpression = arrayConcatExpression == null ? null : arrayConcatExpression.copy(); result.json = json == null ? null : json.copy(); result.booleanValue = booleanValue; return result; }
return arrayConcatExpression.execute(iCurrentRecord, ctx); return ((OMathExpression) value).execute(iCurrentRecord, ctx); } else if (value instanceof OArrayConcatExpression) { return ((OArrayConcatExpression) value).execute(iCurrentRecord, ctx); } else if (value instanceof OJson) { return ((OJson) value).toMap(iCurrentRecord, ctx);
public void extractSubQueries(OIdentifier letAlias, SubQueryCollector collector) { if (mathExpression != null) { mathExpression.extractSubQueries(letAlias, collector); } if (arrayConcatExpression != null) { arrayConcatExpression.extractSubQueries(collector); } if (json != null) { json.extractSubQueries(collector); } }
public Object execute(OResult iCurrentRecord, OCommandContext ctx) { Object result = childExpressions.get(0).execute(iCurrentRecord, ctx); for (int i = 1; i < childExpressions.size(); i++) { result = apply(result, childExpressions.get(i).execute(iCurrentRecord, ctx)); } return result; }