Mercurial > dive4elements > gnv-client
annotate geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 1125:959618206b8a
Write svn revision to MANIFEST file while packaging.
geo-backend/trunk@1212 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 14 Jun 2010 21:14:12 +0000 |
parents | e5e30090c37c |
children | ebeb56428409 |
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 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
|
2 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 import java.util.Date; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
4 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
|
5 |
889
e5e30090c37c
Modified some JavaDoc so that the Warnings that where caused by mistakes are removed.
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
6 import de.intevation.gnv.geobackend.util.DateUtils; |
e5e30090c37c
Modified some JavaDoc so that the Warnings that where caused by mistakes are removed.
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
7 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 * 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
|
10 * This Class stores the Attributevalues of one Result. |
887
b757def3ff55
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
886
diff
changeset
|
11 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
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 */ |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
14 public class DefaultResult |
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
15 implements Result |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
16 { |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 /** |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
18 * THE UID of this Classe |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
19 */ |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
20 private static final long serialVersionUID = -6886218808840982766L; |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
21 /** |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
22 * Array which stores the Columnvalues |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
24 private Object [] values; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 * 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
|
27 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 private ResultDescriptor resultDescriptor = null; |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
29 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 * Constructor |
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 public DefaultResult(ResultDescriptor resultDescriptor) { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 this.resultDescriptor = resultDescriptor; |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
35 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
|
36 } |
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 * @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
|
40 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 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
|
42 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
|
43 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
44 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
45 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
46 * @see de.intevation.gnv.geobackend.base.Result#getDate(int) |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
47 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
48 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
|
49 Object o = values[column]; |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
50 Date d = null; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
51 if(o instanceof Date){ |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
52 d = (Date)o; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
53 }else if (o instanceof GregorianCalendar){ |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
54 d = ((GregorianCalendar)o).getTime(); |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
55 } |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
56 return d; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 * @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
|
61 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 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
|
63 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
|
64 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
65 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
66 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
67 * @see de.intevation.gnv.geobackend.base.Result#getDouble(int) |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
68 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
69 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
|
70 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
|
71 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 |
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 * @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
|
75 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 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
|
77 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
|
78 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
79 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
80 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
81 * @see de.intevation.gnv.geobackend.base.Result#getFloat(int) |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
82 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
83 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
|
84 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
|
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 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
88 * @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
|
89 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
90 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
|
91 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
|
92 return idx > -1 ? getInteger(idx) : -1; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
93 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
95 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
96 * @see de.intevation.gnv.geobackend.base.Result#getInteger(int) |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
97 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
98 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
|
99 Object value = values[column]; |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
100 if (value instanceof Double){ |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
101 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
|
102 } |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
103 return (Integer)value; |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
104 } |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
105 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 * @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
|
108 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 public ResultDescriptor getResultDescriptor() { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 return this.resultDescriptor; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 } |
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 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 * @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
|
115 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 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
|
117 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
|
118 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
|
119 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
120 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
121 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
122 * @see de.intevation.gnv.geobackend.base.Result#getString(int) |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
123 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
124 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
|
125 Object o = values[column]; |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
126 if (o instanceof Date){ |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
127 return DateUtils.getPatternedDateAmer((Date)o); |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
128 } |
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
129 if (o instanceof GregorianCalendar){ |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
130 Date d = ((GregorianCalendar)o).getTime(); |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
131 return DateUtils.getPatternedDateAmer(d); |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
132 } |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
133 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
|
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 /** |
889
e5e30090c37c
Modified some JavaDoc so that the Warnings that where caused by mistakes are removed.
Tim Englich <tim.englich@intevation.de>
parents:
887
diff
changeset
|
137 * @see de.intevation.gnv.geobackend.base.Result#addColumnValue(int, java.lang.Object) |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
139 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
|
140 values[column] = value; |
132
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 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
144 * @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
|
145 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
146 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
|
147 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
|
148 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
149 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
150 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
151 * @see de.intevation.gnv.geobackend.base.Result#getObject(int) |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
152 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
153 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
|
154 return values[column]; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
155 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
157 } |