public OBaseIdentifier(ORecordAttribute attr) { this.suffix = new OSuffixIdentifier(attr); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OBaseIdentifier that = (OBaseIdentifier) o; if (levelZero != null ? !levelZero.equals(that.levelZero) : that.levelZero != null) return false; if (suffix != null ? !suffix.equals(that.suffix) : that.suffix != null) return false; return true; }
public Object execute(Object currentValue, OCommandContext ctx) { if (currentValue instanceof OResult) { return execute((OResult) currentValue, ctx); } if (currentValue instanceof OIdentifiable) { return execute((OIdentifiable) currentValue, ctx); } if (currentValue instanceof Map) { return execute((Map) currentValue, ctx); } if (currentValue instanceof OCommandContext) { return execute((OCommandContext) currentValue); } if (currentValue instanceof Iterable) { return execute((Iterable) currentValue, ctx); } if (currentValue instanceof Iterator) { return execute((Iterator) currentValue, ctx); } if (currentValue == null) { return execute((OResult) null, ctx); } return null; // TODO other cases? }
final public OSuffixIdentifier SuffixIdentifier() throws ParseException { OSuffixIdentifier jjtn000 = new OSuffixIdentifier(JJTSUFFIXIDENTIFIER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1)); try { if (jj_2_73(2147483647)) { 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) { if (fromResult.getProperty("levelZero") != null) { levelZero = new OLevelZeroIdentifier(-1); levelZero.deserialize(fromResult.getProperty("levelZero")); } if (fromResult.getProperty("suffix") != null) { suffix = new OSuffixIdentifier(-1); suffix.deserialize(fromResult.getProperty("suffix")); } }
public OBaseIdentifier copy() { OBaseIdentifier result = new OBaseIdentifier(-1); result.levelZero = levelZero == null ? null : levelZero.copy(); result.suffix = suffix == null ? null : suffix.copy(); return result; }
@Override public int hashCode() { int result = levelZero != null ? levelZero.hashCode() : 0; result = 31 * result + (suffix != null ? suffix.hashCode() : 0); return result; }
public void applyRemove(OResultInternal result, OCommandContext ctx) { if (suffix != null) { suffix.applyRemove(result, ctx); } else { throw new OCommandExecutionException("cannot apply REMOVE " + toString()); } }
public OCollate getCollate(OResult currentRecord, OCommandContext ctx) { return suffix == null ? null : suffix.getCollate(currentRecord, ctx); }
public AggregationContext getAggregationContext(OCommandContext ctx) { if (isAggregate()) { if (levelZero != null) { return levelZero.getAggregationContext(ctx); } else if (suffix != null) { return suffix.getAggregationContext(ctx); } else { throw new OCommandExecutionException("cannot aggregate on " + toString()); } } else { throw new OCommandExecutionException("cannot aggregate on " + toString()); } }
public void extractSubQueries(SubQueryCollector collector) { if (arrayRange != null) { arrayRange.extractSubQueries(collector); } if (condition != null) { condition.extractSubQueries(collector); } if (arraySingleValues != null) { arraySingleValues.extractSubQueries(collector); } if (rightBinaryCondition != null) { rightBinaryCondition.extractSubQueries(collector); } if (methodCall != null) { methodCall.extractSubQueries(collector); } if (suffix != null) { suffix.extractSubQueries(collector); } if (next != null) { next.extractSubQueries(collector); } }
suffix = new OSuffixIdentifier(-1); suffix.deserialize(fromResult.getProperty("suffix"));
public OModifier copy() { OModifier result = new OModifier(-1); result.squareBrackets = squareBrackets; result.arrayRange = arrayRange == null ? null : arrayRange.copy(); result.condition = condition == null ? null : condition.copy(); result.arraySingleValues = arraySingleValues == null ? null : arraySingleValues.copy(); result.rightBinaryCondition = rightBinaryCondition == null ? null : rightBinaryCondition.copy(); result.methodCall = methodCall == null ? null : methodCall.copy(); result.suffix = suffix == null ? null : suffix.copy(); result.next = next == null ? null : next.copy(); return result; }
@Override public int hashCode() { int result = (squareBrackets ? 1 : 0); result = 31 * result + (arrayRange != null ? arrayRange.hashCode() : 0); result = 31 * result + (condition != null ? condition.hashCode() : 0); result = 31 * result + (arraySingleValues != null ? arraySingleValues.hashCode() : 0); result = 31 * result + (rightBinaryCondition != null ? rightBinaryCondition.hashCode() : 0); result = 31 * result + (methodCall != null ? methodCall.hashCode() : 0); result = 31 * result + (suffix != null ? suffix.hashCode() : 0); result = 31 * result + (next != null ? next.hashCode() : 0); return result; }
public void applyRemove(Object currentValue, OResultInternal originalRecord, OCommandContext ctx) { if (next != null) { Object val = calculateLocal(originalRecord, currentValue, ctx); next.applyRemove(val, originalRecord, ctx); } else { if (arrayRange != null) { arrayRange.applyRemove(currentValue, originalRecord, ctx); } else if (condition != null) { //TODO throw new UnsupportedOperationException("Remove on conditional filtering will be supported soon"); } else if (arraySingleValues != null) { arraySingleValues.applyRemove(currentValue, originalRecord, ctx); } else if (rightBinaryCondition != null) { throw new UnsupportedOperationException("Remove on conditional filtering will be supported soon"); } else if (suffix != null) { suffix.applyRemove(currentValue, ctx); } else { throw new OCommandExecutionException("cannot apply REMOVE " + toString()); } } }
public Object execute(Iterable iterable, OCommandContext ctx) { if (star) { return null; } List<Object> result = new ArrayList<>(); for (Object o : iterable) { result.add(execute(o, ctx)); } return result; }
public OBaseIdentifier(OIdentifier identifier) { this.suffix = new OSuffixIdentifier(identifier); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OModifier oModifier = (OModifier) o; if (squareBrackets != oModifier.squareBrackets) return false; if (arrayRange != null ? !arrayRange.equals(oModifier.arrayRange) : oModifier.arrayRange != null) return false; if (condition != null ? !condition.equals(oModifier.condition) : oModifier.condition != null) return false; if (arraySingleValues != null ? !arraySingleValues.equals(oModifier.arraySingleValues) : oModifier.arraySingleValues != null) return false; if (rightBinaryCondition != null ? !rightBinaryCondition.equals(oModifier.rightBinaryCondition) : oModifier.rightBinaryCondition != null) return false; if (methodCall != null ? !methodCall.equals(oModifier.methodCall) : oModifier.methodCall != null) return false; if (suffix != null ? !suffix.equals(oModifier.suffix) : oModifier.suffix != null) return false; if (next != null ? !next.equals(oModifier.next) : oModifier.next != null) return false; return true; }
public Object execute(OResult iCurrentRecord, OCommandContext ctx) { if (levelZero != null) { return levelZero.execute(iCurrentRecord, ctx); } if (suffix != null) { return suffix.execute(iCurrentRecord, ctx); } return null; }
public OSuffixIdentifier copy() { OSuffixIdentifier result = new OSuffixIdentifier(-1); result.identifier = identifier == null ? null : identifier.copy(); result.recordAttribute = recordAttribute == null ? null : recordAttribute.copy(); result.star = star; return result; }