diff options
Diffstat (limited to 'petascope/src/petascope/wcps/server/core/CondenseOperation.java')
-rw-r--r-- | petascope/src/petascope/wcps/server/core/CondenseOperation.java | 107 |
1 files changed, 53 insertions, 54 deletions
diff --git a/petascope/src/petascope/wcps/server/core/CondenseOperation.java b/petascope/src/petascope/wcps/server/core/CondenseOperation.java index ec955f5..3e5c040 100644 --- a/petascope/src/petascope/wcps/server/core/CondenseOperation.java +++ b/petascope/src/petascope/wcps/server/core/CondenseOperation.java @@ -14,61 +14,60 @@ * 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.WCPSException;
-import org.w3c.dom.*;
-
-public class CondenseOperation implements IRasNode {
-
- private String name;
-
- public CondenseOperation(Node node, XmlQuery xq) throws WCPSException {
- while ((node != null) && node.getNodeName().equals("#text")) {
- node = node.getNextSibling();
- }
-
- System.err.println("Parsing condense Operation: " + node.getNodeName());
-
- String text = node.getNodeName();
- this.name = formatOperation(text);
-
- if (name == null) {
- throw new WCPSException("Unknown condense operation: " + text);
- }
- }
-
- private String formatOperation(String name) {
- String shortOp = null;
- if (name.equals("opPlus")) {
- shortOp = "+";
- }
- if (name.equals("opMult")) {
- shortOp = "*";
- }
- if (name.equals("opMin")) {
- shortOp = "min";
- }
- if (name.equals("opMax")) {
- shortOp = "max";
- }
- if (name.equals("opAnd")) {
- shortOp = "and";
- }
- if (name.equals("opOr")) {
- shortOp = "or";
- }
-
- return shortOp;
- }
-
- public String toRasQL() {
- return name;
- }
-}
+package petascope.wcps.server.core; + +import petascope.exceptions.WCPSException; +import org.w3c.dom.*; + +public class CondenseOperation implements IRasNode { + + private String name; + + public CondenseOperation(Node node, XmlQuery xq) throws WCPSException { + while ((node != null) && node.getNodeName().equals("#text")) { + node = node.getNextSibling(); + } + + System.err.println("Parsing condense Operation: " + node.getNodeName()); + + String text = node.getNodeName(); + this.name = formatOperation(text); + + if (name == null) { + throw new WCPSException("Unknown condense operation: " + text); + } + } + + private String formatOperation(String name) { + String shortOp = null; + if (name.equals("opPlus")) { + shortOp = "+"; + } + if (name.equals("opMult")) { + shortOp = "*"; + } + if (name.equals("opMin")) { + shortOp = "min"; + } + if (name.equals("opMax")) { + shortOp = "max"; + } + if (name.equals("opAnd")) { + shortOp = "and"; + } + if (name.equals("opOr")) { + shortOp = "or"; + } + + return shortOp; + } + + public String toRasQL() { + return name; + } +} |