1 29 30 package com.caucho.quercus.env; 31 32 import java.io.IOException ; 33 import java.io.PrintWriter ; 34 35 38 public class DefaultValue extends NullValue { 39 public static final DefaultValue DEFAULT 40 = new DefaultValue(); 41 42 private DefaultValue() 43 { 44 } 45 46 49 public static DefaultValue create() 50 { 51 return DEFAULT; 52 } 53 54 57 public boolean toBoolean() 58 { 59 return false; 60 } 61 62 65 public long toLong() 66 { 67 return 0; 68 } 69 70 73 public double toDouble() 74 { 75 return 0; 76 } 77 78 81 public Object toObject() 82 { 83 return ""; 84 } 85 86 90 public void print(Env env) 91 { 92 } 93 94 98 public String toString() 99 { 100 return ""; 101 } 102 103 108 public void generate(PrintWriter out) 109 throws IOException 110 { 111 out.print("DefaultValue.DEFAULT"); 112 } 113 114 119 public void generateLong(PrintWriter out) 120 throws IOException 121 { 122 out.print("0"); 123 } 124 125 130 public void generateString(PrintWriter out) 131 throws IOException 132 { 133 out.print("\"\""); 134 } 135 136 140 private Object readResolve() 141 { 142 return DEFAULT; 143 } 144 } 145 146 | Popular Tags |