1 52 53 package freemarker.template; 54 55 import java.io.Serializable ; 56 57 58 66 public final class SimpleNumber implements TemplateNumberModel, Serializable { 67 68 71 private Number value; 72 73 public SimpleNumber(Number value) { 74 this.value = value; 75 } 76 77 public SimpleNumber(byte val) { 78 this.value = new Byte (val); 79 } 80 81 public SimpleNumber(short val) { 82 this.value = new Short (val); 83 } 84 85 public SimpleNumber(int val) { 86 this.value = new Integer (val); 87 } 88 89 public SimpleNumber(long val) { 90 this.value = new Long (val); 91 } 92 93 public SimpleNumber(float val) { 94 this.value = new Float (val); 95 } 96 97 public SimpleNumber(double val) { 98 this.value = new Double (val); 99 } 100 101 public Number getAsNumber() { 102 return value; 103 } 104 105 public String toString() { 106 return value.toString(); 107 } 108 } 109 | Popular Tags |