comparison geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 132:5a583cff97ea

Implementation of the Datainfrastructure for fetching Data from different DataStores. geo-backend/trunk@12 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 04 Sep 2009 08:11:30 +0000
parents
children d43ff60acda4
comparison
equal deleted inserted replaced
131:d8ff739b9f3b 132:5a583cff97ea
1 /**
2 *
3 */
4 package de.intevation.gnv.geobackend.base;
5
6 import java.util.Date;
7 import java.util.HashMap;
8
9 /**
10 * Defaultimplementation of the Interface Result.
11 * This Class stores the Attributevalues of one Result.
12 * @author Tim Englich <tim.englich@intevation.de>
13 *
14 */
15 public class DefaultResult implements Result {
16
17 /**
18 * HashMap which stores the Columnvalues identified by the unique Columnname
19 */
20 private HashMap<String, Object> columnValues = new HashMap<String, Object>();
21
22
23 /**
24 * The ResultDescriptor which describes the ColumnValues
25 */
26 private ResultDescriptor resultDescriptor = null;
27
28 /**
29 * Constructor
30 */
31 public DefaultResult(ResultDescriptor resultDescriptor) {
32 super();
33 this.resultDescriptor = resultDescriptor;
34 }
35
36 /**
37 * @see de.intevation.gnv.geobackend.base.Result#getDate(java.lang.String)
38 */
39 public Date getDate(String columnName) {
40 return (Date)this.columnValues.get(columnName);
41 }
42
43 /**
44 * @see de.intevation.gnv.geobackend.base.Result#getDouble(java.lang.String)
45 */
46 public Double getDouble(String columnName) {
47 return (Double)this.columnValues.get(columnName);
48 }
49
50 /**
51 * @see de.intevation.gnv.geobackend.base.Result#getFloat(java.lang.String)
52 */
53 public Float getFloat(String columnName) {
54 return (Float)this.columnValues.get(columnName);
55 }
56
57 /**
58 * @see de.intevation.gnv.geobackend.base.Result#getInteger(java.lang.String)
59 */
60 public Integer getInteger(String columnName) {
61 return (Integer)this.columnValues.get(columnName);
62 }
63
64 /**
65 * @see de.intevation.gnv.geobackend.base.Result#getResultDescriptor()
66 */
67 public ResultDescriptor getResultDescriptor() {
68 return this.resultDescriptor;
69 }
70
71 /**
72 * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String)
73 */
74 public String getString(String columnName) {
75 return this.columnValues.get(columnName).toString();
76 }
77
78 /**
79 * @see de.intevation.gnv.geobackend.base.Result#addColumnValue(java.lang.String, java.lang.Object)
80 */
81 public void addColumnValue(String columnName, Object value) {
82 this.columnValues.put(columnName, value);
83 }
84
85 /**
86 * @see de.intevation.gnv.geobackend.base.Result#getObject(java.lang.String)
87 */
88 public Object getObject(String columnName) {
89 return this.columnValues.get(columnName);
90 }
91
92 }

http://dive4elements.wald.intevation.org