Mercurial > dive4elements > gnv-client
annotate geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 543:fac02bf1c685
Added Rasterdatasupport to the ARCSDE-Statement
geo-backend/trunk@504 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 04 Jan 2010 15:22:09 +0000 |
parents | da2da7bb1aa1 |
children | 12f88239fb33 |
rev | line source |
---|---|
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.geobackend.base; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 import java.util.Date; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
7 import java.util.GregorianCalendar; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import java.util.HashMap; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
10 import de.intevation.gnv.geobackend.util.DateUtils; |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
11 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 * Defaultimplementation of the Interface Result. |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 * This Class stores the Attributevalues of one Result. |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 * @author Tim Englich <tim.englich@intevation.de> |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 * |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 */ |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
18 public class DefaultResult |
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
19 implements Result |
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
20 { |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 /** |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
22 * THE UID of this Classe |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
23 */ |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
24 private static final long serialVersionUID = -6886218808840982766L; |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
25 |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
26 |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
27 /** |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 * HashMap which stores the Columnvalues identified by the unique Columnname |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
30 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
31 private Object [] values; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 * The ResultDescriptor which describes the ColumnValues |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 private ResultDescriptor resultDescriptor = null; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 * Constructor |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 public DefaultResult(ResultDescriptor resultDescriptor) { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 this.resultDescriptor = resultDescriptor; |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
43 values = new Object[resultDescriptor.getColumnCount()]; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 * @see de.intevation.gnv.geobackend.base.Result#getDate(java.lang.String) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 public Date getDate(String columnName) { |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
50 return getDate(resultDescriptor.getColumnIndex(columnName)); |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
51 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
52 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
53 public Date getDate(int column) { |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
54 Object o = values[column]; |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
55 Date d = null; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
56 if(o instanceof Date){ |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
57 d = (Date)o; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
58 }else if (o instanceof GregorianCalendar){ |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
59 d = ((GregorianCalendar)o).getTime(); |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
60 } |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
61 return d; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 * @see de.intevation.gnv.geobackend.base.Result#getDouble(java.lang.String) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
67 public Double getDouble(String columnName) { |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
68 return getDouble(resultDescriptor.getColumnIndex(columnName)); |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
69 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
70 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
71 public Double getDouble(int column) { |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
72 return (Double)values[column]; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
74 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
75 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 * @see de.intevation.gnv.geobackend.base.Result#getFloat(java.lang.String) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
77 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 public Float getFloat(String columnName) { |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
79 return getFloat(resultDescriptor.getColumnIndex(columnName)); |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
80 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
81 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
82 public Float getFloat(int column) { |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
83 return (Float)values[column]; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
85 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
87 * @see de.intevation.gnv.geobackend.base.Result#getInteger(java.lang.String) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
88 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
89 public Integer getInteger(String columnName) { |
384
da2da7bb1aa1
Fixed a bug in DefaultResult when querying an index out of bounds.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
382
diff
changeset
|
90 int idx = resultDescriptor.getColumnIndex(columnName); |
da2da7bb1aa1
Fixed a bug in DefaultResult when querying an index out of bounds.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
382
diff
changeset
|
91 |
da2da7bb1aa1
Fixed a bug in DefaultResult when querying an index out of bounds.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
382
diff
changeset
|
92 return idx > -1 ? getInteger(idx) : -1; |
da2da7bb1aa1
Fixed a bug in DefaultResult when querying an index out of bounds.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
382
diff
changeset
|
93 //return getInteger(resultDescriptor.getColumnIndex(columnName)); |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
96 public Integer getInteger(int column) { |
272
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
97 Object value = values[column]; |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
98 if (value instanceof Double){ |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
99 value = new Integer(((Double)value).intValue()); |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
100 } |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
101 return (Integer)value; |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
102 } |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
103 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
104 * @see de.intevation.gnv.geobackend.base.Result#getResultDescriptor() |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 public ResultDescriptor getResultDescriptor() { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 return this.resultDescriptor; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 public String getString(String columnName) { |
382
4af6379ac20b
Changed exception handling if a the value of a column, which is not contained in Result, is requested. Will not throw an exception but return null.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
272
diff
changeset
|
114 int idx = resultDescriptor.getColumnIndex(columnName); |
4af6379ac20b
Changed exception handling if a the value of a column, which is not contained in Result, is requested. Will not throw an exception but return null.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
272
diff
changeset
|
115 |
4af6379ac20b
Changed exception handling if a the value of a column, which is not contained in Result, is requested. Will not throw an exception but return null.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
272
diff
changeset
|
116 return idx > -1 ? getString(idx) : null; |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
117 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
118 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
119 public String getString(int column) { |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
120 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
121 Object o = values[column]; |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
122 |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
123 if (o instanceof Date){ |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
124 return DateUtils.getPatternedDateAmer((Date)o); |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
125 } |
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
126 |
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
127 if (o instanceof GregorianCalendar){ |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
128 Date d = ((GregorianCalendar)o).getTime(); |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
129 return DateUtils.getPatternedDateAmer(d); |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
130 } |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
131 |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
132 return o != null ? o.toString() : null; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
133 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
134 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 * @see de.intevation.gnv.geobackend.base.Result#addColumnValue(java.lang.String, java.lang.Object) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
138 public void addColumnValue(int column, Object value) { |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
139 values[column] = value; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
141 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
142 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
143 * @see de.intevation.gnv.geobackend.base.Result#getObject(java.lang.String) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
144 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
145 public Object getObject(String columnName) { |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
146 return getObject(resultDescriptor.getColumnIndex(columnName)); |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
147 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
148 |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
149 public Object getObject(int column) { |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
150 return values[column]; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
151 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
152 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
153 } |