1 package com.quadcap.sql; 2 3 40 41 import java.io.IOException ; 42 43 import java.util.Enumeration ; 44 import java.util.Vector ; 45 46 import java.sql.SQLException ; 47 48 import com.quadcap.sql.types.Op; 49 import com.quadcap.sql.types.Type; 50 import com.quadcap.sql.types.Value; 51 52 import com.quadcap.util.Debug; 53 54 59 60 public abstract class Expression { 61 65 public abstract int rank(); 66 67 70 public abstract Type getType(Session session, Cursor cursor) 71 throws SQLException ; 72 73 76 public Value getValue(Session session, Cursor cursor) 77 throws SQLException 78 { 79 return null; 80 } 81 82 85 public Row getValues(Session session, Cursor cursor) throws SQLException { 86 if (rank() == 0) { 87 Value v = getValue(session, cursor); 88 Row row = new Row(1); 89 row.set(1, v); 90 return row; 91 } else { 92 throw new SQLException ("getValues, rank = " + rank(), "Q0000"); 93 } 94 } 95 96 99 public Cursor getCursor(Session session, Cursor cursor) 100 throws SQLException 101 { 102 return null; 103 } 104 105 108 public void invert() throws antlr.RecognitionException { 109 throw new antlr.RecognitionException("Error, not a boolean expression"); 110 } 111 112 115 public void visitSubExpressions(ExpressionVisitor v) {} 116 117 118 public String getName() { return null; } 119 120 abstract public String toString(); 121 122 } 123 | Popular Tags |