comparison geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 140:2f1b87e1a40c

Added formatted Date Handling in getString Method geo-backend/trunk@109 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 21 Sep 2009 15:30:07 +0000
parents d43ff60acda4
children b02310d7ffee
comparison
equal deleted inserted replaced
139:9f2eaefe9dd4 140:2f1b87e1a40c
4 package de.intevation.gnv.geobackend.base; 4 package de.intevation.gnv.geobackend.base;
5 5
6 import java.util.Date; 6 import java.util.Date;
7 import java.util.GregorianCalendar; 7 import java.util.GregorianCalendar;
8 import java.util.HashMap; 8 import java.util.HashMap;
9
10 import de.intevation.gnv.geobackend.util.DateUtils;
9 11
10 /** 12 /**
11 * Defaultimplementation of the Interface Result. 13 * Defaultimplementation of the Interface Result.
12 * This Class stores the Attributevalues of one Result. 14 * This Class stores the Attributevalues of one Result.
13 * @author Tim Englich <tim.englich@intevation.de> 15 * @author Tim Englich <tim.englich@intevation.de>
81 83
82 /** 84 /**
83 * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String) 85 * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String)
84 */ 86 */
85 public String getString(String columnName) { 87 public String getString(String columnName) {
86 return this.columnValues.get(columnName).toString(); 88 Object o = this.columnValues.get(columnName);
89 if(o instanceof Date){
90 return DateUtils.getPatternedDateAmer((Date)o);
91 }else if (o instanceof GregorianCalendar){
92 Date d = ((GregorianCalendar)o).getTime();
93 return DateUtils.getPatternedDateAmer(d);
94 }else{
95 return this.columnValues.get(columnName).toString();
96 }
87 } 97 }
88 98
89 /** 99 /**
90 * @see de.intevation.gnv.geobackend.base.Result#addColumnValue(java.lang.String, java.lang.Object) 100 * @see de.intevation.gnv.geobackend.base.Result#addColumnValue(java.lang.String, java.lang.Object)
91 */ 101 */

http://dive4elements.wald.intevation.org