/* Generated By:JJTree: Do not edit this line. ONotInCondition.java Version 4.3 */ /* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package com.orientechnologies.orient.core.sql.parser; import com.orientechnologies.orient.core.command.OCommandContext; import com.orientechnologies.orient.core.db.record.OIdentifiable; import java.util.ArrayList; import java.util.List; import java.util.Map; public class ONotInCondition extends OBooleanExpression { protected OExpression left; protected OBinaryCompareOperator operator; protected OSelectStatement rightStatement; protected Object right; protected OInputParameter rightParam; protected OMathExpression rightMathExpression; private static final Object UNSET = new Object(); private Object inputFinalValue = UNSET; public ONotInCondition(int id) { super(id); } public ONotInCondition(OrientSql p, int id) { super(p, id); } /** * Accept the visitor. **/ public Object jjtAccept(OrientSqlVisitor visitor, Object data) { return visitor.visit(this, data); } @Override public boolean evaluate(OIdentifiable currentRecord, OCommandContext ctx) { return false; } public void toString(Map<Object, Object> params, StringBuilder builder) { left.toString(params, builder); builder.append(" NOT IN "); if (rightStatement != null) { builder.append("("); rightStatement.toString(params, builder); builder.append(")"); } else if (right != null) { builder.append(convertToString(right)); } else if (rightParam != null) { rightParam.toString(params, builder); } else if (rightMathExpression != null) { rightMathExpression.toString(params, builder); } } private String convertToString(Object o) { if (o instanceof String) { return "\"" + ((String) o).replaceAll("\"", "\\\"") + "\""; } return o.toString(); } @Override public boolean supportsBasicCalculation() { if (operator != null && !operator.supportsBasicCalculation()) { return false; } if (left != null && !left.supportsBasicCalculation()) { return false; } if (rightMathExpression != null && !rightMathExpression.supportsBasicCalculation()) { return false; } return true; } @Override protected int getNumberOfExternalCalculations() { int total = 0; if (operator != null && !operator.supportsBasicCalculation()) { total++; } if (left != null && !left.supportsBasicCalculation()) { total++; } if (rightMathExpression != null && !rightMathExpression.supportsBasicCalculation()) { total++; } return total; } @Override protected List<Object> getExternalCalculationConditions() { List<Object> result = new ArrayList<Object>(); if (operator != null && !operator.supportsBasicCalculation()) { result.add(this); } if (rightMathExpression != null && !rightMathExpression.supportsBasicCalculation()) { result.add(rightMathExpression); } return result; } @Override public List<String> getMatchPatternInvolvedAliases() { List<String> leftX = left == null ? null : left.getMatchPatternInvolvedAliases(); List<String> rightX = rightMathExpression == null ? null : rightMathExpression.getMatchPatternInvolvedAliases(); List<String> result = new ArrayList<String>(); if (leftX != null) { result.addAll(leftX); } if (rightX != null) { result.addAll(rightX); } return result.size() == 0 ? null : result; } } /* JavaCC - OriginalChecksum=8fb82bf72cc7d9cbdf2f9e2323ca8ee1 (do not edit this line) */