01: package simpleorm.simplewebapp.scalarFields;
02:
03: import simpleorm.simplewebapp.core.WField;
04:
05: public class WFieldLong extends WField {
06: public WFieldLong(String name) {
07: super (name);
08: }
09:
10: public WFieldLong(String name, String widget) {
11: super (name, widget);
12: }
13:
14: public long getLongValue(long defalt) {
15: return value != null ? (Long) value : defalt;
16: }
17:
18: protected String format() {
19: return value == null ? null : value.toString();
20: }
21:
22: protected void parse(String rawText) {
23: this .value = rawText == null ? null : Long.valueOf(rawText);
24: }
25:
26: public Class getValueClass() {
27: return Long.class;
28: }
29:
30: public boolean getBooleanValue(boolean defalt) {
31: if (value == null)
32: return false;
33: return (Long) value != 0;
34: }
35:
36: public Long getValue() {
37: return (Long) super.getValue();
38: }
39:
40: }
|