1 28 29 package com.caucho.db.sql; 30 31 import com.caucho.log.Log; 32 33 import java.sql.SQLException ; 34 import java.util.ArrayList ; 35 import java.util.logging.Logger ; 36 37 class DoubleExpr extends Expr { 38 private static final Logger log = Log.open(DoubleExpr.class); 39 40 private double _value; 41 42 DoubleExpr(double value) 43 { 44 _value = value; 45 } 46 47 50 public Class getType() 51 { 52 return double.class; 53 } 54 55 58 public long subCost(ArrayList <FromItem> fromList) 59 { 60 return 0; 61 } 62 63 public int evalInt(QueryContext context) 64 throws SQLException 65 { 66 return (int) _value; 67 } 68 69 public long evalLong(QueryContext context) 70 throws SQLException 71 { 72 return (long) _value; 73 } 74 75 public double evalDouble(QueryContext context) 76 throws SQLException 77 { 78 return _value; 79 } 80 81 public String evalString(QueryContext context) 82 throws SQLException 83 { 84 return String.valueOf(_value); 85 } 86 87 public String toString() 88 { 89 return String.valueOf(_value); 90 } 91 } 92 | Popular Tags |