1 34 package smallsql.database; 35 36 37 41 abstract class ExpressionFunctionReturnInt extends ExpressionFunction { 42 43 44 45 boolean isNull() throws Exception { 46 return param1.isNull(); 47 } 48 49 50 final boolean getBoolean() throws Exception { 51 return getInt() != 0; 52 } 53 54 55 final long getLong() throws Exception { 56 return getInt(); 57 } 58 59 60 final float getFloat() throws Exception { 61 return getInt(); 62 } 63 64 65 final double getDouble() throws Exception { 66 return getInt(); 67 } 68 69 70 final long getMoney() throws Exception { 71 return getInt() * 10000; 72 } 73 74 75 final MutableNumeric getNumeric() throws Exception { 76 if(isNull()) return null; 77 return new MutableNumeric(getInt()); 78 } 79 80 81 Object getObject() throws Exception { 82 if(isNull()) return null; 83 return Utils.getInteger(getInt()); 84 } 85 86 87 final String getString() throws Exception { 88 if(isNull()) return null; 89 return String.valueOf(getInt()); 90 } 91 92 93 final int getDataType() { 94 return SQLTokenizer.INT; 95 } 96 97 } 98 | Popular Tags |