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 LongExpr extends Expr { 38 private static final Logger log = Log.open(LongExpr.class); 39 40 private long _value; 41 42 LongExpr(long value) 43 { 44 _value = value; 45 } 46 47 50 public Class getType() 51 { 52 return long.class; 53 } 54 55 58 public long subCost(ArrayList <FromItem> fromList) 59 { 60 return 0; 61 } 62 63 70 public long evalLong(QueryContext context) 71 throws SQLException 72 { 73 return _value; 74 } 75 76 83 public long evalDate(QueryContext context) 84 throws SQLException 85 { 86 return _value; 87 } 88 89 96 public double evalDouble(QueryContext context) 97 throws SQLException 98 { 99 return _value; 100 } 101 102 109 public String evalString(QueryContext context) 110 throws SQLException 111 { 112 return String.valueOf(_value); 113 } 114 115 121 public void evalToResult(QueryContext context, SelectResult result) 122 { 123 result.writeLong(_value); 124 } 125 126 public String toString() 127 { 128 return String.valueOf(_value); 129 } 130 } 131 | Popular Tags |