1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.compiler.MethodBuilder; 25 import org.apache.derby.iapi.services.compiler.LocalField; 26 import org.apache.derby.iapi.reference.ClassName; 27 28 29 import org.apache.derby.iapi.services.sanity.SanityManager; 30 31 import org.apache.derby.iapi.error.StandardException; 32 33 import org.apache.derby.iapi.types.TypeId; 34 35 import org.apache.derby.iapi.types.DataValueDescriptor; 36 import org.apache.derby.iapi.types.BooleanDataValue; 37 import org.apache.derby.iapi.types.TypeId; 38 import org.apache.derby.iapi.types.DataTypeDescriptor; 39 40 import org.apache.derby.impl.sql.compile.ExpressionClassBuilder; 41 import org.apache.derby.iapi.services.classfile.VMOpcode; 42 43 import java.lang.reflect.Modifier ; 44 45 52 53 public final class NotNode extends UnaryLogicalOperatorNode 54 { 55 60 61 public void init(Object operand) 62 { 63 super.init(operand, "not"); 64 } 65 66 80 ValueNode eliminateNots(boolean underNotNode) 81 throws StandardException 82 { 83 return operand.eliminateNots(! underNotNode); 84 } 85 86 94 95 public void generateExpression(ExpressionClassBuilder acb, 96 MethodBuilder mb) 97 throws StandardException 98 { 99 105 106 109 String interfaceName = getTypeCompiler().interfaceName(); 110 LocalField field = acb.newFieldDeclaration(Modifier.PRIVATE, interfaceName); 111 115 116 117 operand.generateExpression(acb, mb); 118 mb.upCast(ClassName.DataValueDescriptor); 119 120 mb.dup(); 122 mb.push(false); 124 acb.generateDataValue(mb, getTypeCompiler(), field); 125 mb.upCast(ClassName.DataValueDescriptor); 126 127 mb.callMethod(VMOpcode.INVOKEINTERFACE, (String ) null, "equals", interfaceName, 2); 128 } 129 } 130 | Popular Tags |