summaryrefslogtreecommitdiffstats
path: root/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
diff options
context:
space:
mode:
authorDimitar Misev <dimitar@debian.(none)>2011-02-05 22:44:35 +0100
committerwww-data <www-data@ubuntu.localdomain>2011-02-16 10:01:49 +0100
commit3d356cc9ef7b1055242256c00a2e6b93b5462880 (patch)
tree977d6292418f8bce19632e10e13ac39da617c226 /petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
parent054f18a0e07c429609aae393f6bde67f21f9b82c (diff)
downloadrasdaman-upstream-3d356cc9ef7b1055242256c00a2e6b93b5462880.tar.gz
rasdaman-upstream-3d356cc9ef7b1055242256c00a2e6b93b5462880.tar.xz
rasdaman-upstream-3d356cc9ef7b1055242256c00a2e6b93b5462880.zip
WCS 2.0 implementation in PetascopeHEADmaster
Diffstat (limited to 'petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java')
-rw-r--r--petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java96
1 files changed, 47 insertions, 49 deletions
diff --git a/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java b/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
index b12c12f..2494dcd 100644
--- a/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
+++ b/petascope/src/petascope/wcps/server/core/ReduceScalarExpr.java
@@ -14,56 +14,54 @@
* You should have received a copy of the GNU General Public License
* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
*
- * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
- rasdaman GmbH.
+ * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH.
*
* For more information please see <http://www.rasdaman.org>
* or contact Peter Baumann via <baumann@rasdaman.com>.
*/
-package petascope.wcps.server.core;
-
-import petascope.wcps.server.exceptions.InvalidCrsException;
-import petascope.wcps.server.exceptions.WCPSException;
-import org.w3c.dom.*;
-
-public class ReduceScalarExpr implements IRasNode {
-
- CoverageExpr expr;
- String op;
-
- public ReduceScalarExpr(Node node, XmlQuery xq) throws WCPSException, InvalidCrsException {
- if (node.getNodeName().equals("reduce")) {
- node = node.getFirstChild();
- }
- while ((node != null) && node.getNodeName().equals("#text")) {
- node = node.getNextSibling();
- }
-
- System.err.println("Trying to parse ReduceScalarExpr ");
- String nodeName = node.getNodeName();
-
- if (nodeName.equals("all") || nodeName.equals("some") || nodeName.equals("count")
- || nodeName.equals("add") || nodeName.equals("avg") || nodeName.equals("min")
- || nodeName.equals("max")) {
- op = nodeName;
-
- if (!op.equals("all") && !op.equals("some")) {
- op = op + "_cells";
- }
-
- node = node.getFirstChild();
-
- while ((node != null) && (node.getNodeName().equals("#text"))) {
- node = node.getNextSibling();
- }
-
- expr = new CoverageExpr(node, xq);
- } else {
- throw new WCPSException("invalid ReduceScalarExprType node : " + nodeName);
- }
- }
-
- public String toRasQL() {
- return op + "(" + expr.toRasQL() + ")";
- }
-}
+package petascope.wcps.server.core;
+
+import petascope.exceptions.WCPSException;
+import org.w3c.dom.*;
+
+public class ReduceScalarExpr implements IRasNode {
+
+ CoverageExpr expr;
+ String op;
+
+ public ReduceScalarExpr(Node node, XmlQuery xq) throws WCPSException {
+ if (node.getNodeName().equals("reduce")) {
+ node = node.getFirstChild();
+ }
+ while ((node != null) && node.getNodeName().equals("#text")) {
+ node = node.getNextSibling();
+ }
+
+ System.err.println("Trying to parse ReduceScalarExpr ");
+ String nodeName = node.getNodeName();
+
+ if (nodeName.equals("all") || nodeName.equals("some") || nodeName.equals("count")
+ || nodeName.equals("add") || nodeName.equals("avg") || nodeName.equals("min")
+ || nodeName.equals("max")) {
+ op = nodeName;
+
+ if (!op.equals("all") && !op.equals("some")) {
+ op = op + "_cells";
+ }
+
+ node = node.getFirstChild();
+
+ while ((node != null) && (node.getNodeName().equals("#text"))) {
+ node = node.getNextSibling();
+ }
+
+ expr = new CoverageExpr(node, xq);
+ } else {
+ throw new WCPSException("invalid ReduceScalarExprType node : " + nodeName);
+ }
+ }
+
+ public String toRasQL() {
+ return op + "(" + expr.toRasQL() + ")";
+ }
+}