Mercurial > dive4elements > gnv-client
annotate geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 1142:12abbf15f18a
dummy merge for repo head
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:15:20 +0200 |
parents | ebeb56428409 |
children |
rev | line source |
---|---|
1127
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
1 /* |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
3 * |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
7 */ |
ebeb56428409
Added license headers and license file.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
889
diff
changeset
|
8 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 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
|
10 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 import java.util.Date; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
12 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
|
13 |
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
|
14 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
|
15 |
132
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 * 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
|
18 * 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
|
19 * @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
|
20 * |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 */ |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
22 public class DefaultResult |
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
23 implements Result |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
24 { |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 /** |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
26 * THE UID of this Classe |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
27 */ |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
28 private static final long serialVersionUID = -6886218808840982766L; |
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
29 /** |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
30 * 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
|
31 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
32 private Object [] values; |
132
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; |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
37 |
132
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 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
53 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
54 * @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
|
55 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
56 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
|
57 Object o = values[column]; |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
58 Date d = null; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
59 if(o instanceof Date){ |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
60 d = (Date)o; |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
61 }else if (o instanceof GregorianCalendar){ |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
62 d = ((GregorianCalendar)o).getTime(); |
137
d43ff60acda4
Some little performanceimprofments and Bugfixes
Tim Englich <tim.englich@intevation.de>
parents:
132
diff
changeset
|
63 } |
141
b02310d7ffee
Make Classes Serializable for Storing in ArtifactDatabase
Tim Englich <tim.englich@intevation.de>
parents:
140
diff
changeset
|
64 return d; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 } |
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 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 * @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
|
69 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 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
|
71 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
|
72 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
73 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
74 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
75 * @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
|
76 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
77 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
|
78 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
|
79 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
80 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
82 * @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
|
83 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 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
|
85 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
|
86 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
87 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
88 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
89 * @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
|
90 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
91 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
|
92 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
|
93 } |
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 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 * @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
|
97 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 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
|
99 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
|
100 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
|
101 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
102 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
103 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
104 * @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
|
105 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
106 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
|
107 Object value = values[column]; |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
108 if (value instanceof Double){ |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
109 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
|
110 } |
05912f0304ac
Added Integer-Support for DoubleValues because the ArcSDE does
Tim Englich <tim.englich@intevation.de>
parents:
271
diff
changeset
|
111 return (Integer)value; |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
112 } |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
884
diff
changeset
|
113 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 * @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
|
116 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
117 public ResultDescriptor getResultDescriptor() { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 return this.resultDescriptor; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
121 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
122 * @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
|
123 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
124 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
|
125 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
|
126 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
|
127 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
128 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
129 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
130 * @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
|
131 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
132 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
|
133 Object o = values[column]; |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
134 if (o instanceof Date){ |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
135 return DateUtils.getPatternedDateAmer((Date)o); |
270
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
136 } |
1fe93e3c80c0
DefaultResult now directly inherits from HashMap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
141
diff
changeset
|
137 if (o instanceof GregorianCalendar){ |
140
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
138 Date d = ((GregorianCalendar)o).getTime(); |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
139 return DateUtils.getPatternedDateAmer(d); |
2f1b87e1a40c
Added formatted Date Handling in getString Method
Tim Englich <tim.englich@intevation.de>
parents:
137
diff
changeset
|
140 } |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
141 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
|
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 /** |
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
|
145 * @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
|
146 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
147 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
|
148 values[column] = value; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 |
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 * @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
|
153 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
154 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
|
155 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
|
156 } |
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
157 |
884
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
158 /** |
12f88239fb33
Updated Javadocs to the Listed Classes.
Tim Englich <tim.englich@intevation.de>
parents:
384
diff
changeset
|
159 * @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
|
160 */ |
271
8aad9d098b08
Integrated Patch of issue57 to get some Memoryusage-improvements
Tim Englich <tim.englich@intevation.de>
parents:
270
diff
changeset
|
161 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
|
162 return values[column]; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
163 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
164 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
165 } |