aboutsummaryrefslogtreecommitdiff
path: root/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java')
-rw-r--r--spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java97
1 files changed, 97 insertions, 0 deletions
diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java
new file mode 100644
index 000000000..cbf7ff26e
--- /dev/null
+++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java
@@ -0,0 +1,97 @@
+/*
+* Copyright 2003 Federal Chancellery Austria
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package at.gv.egovernment.moa.spss.server.iaik.xml;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import iaik.server.modules.xml.XPath2Transformation;
+
+/**
+ * An object encapsulating a <code>Transformation</code> containing several
+ * XPath-Filter2 expressions.
+ *
+ * @author Patrick Peck
+ * @version $Id$
+ */
+public class XPath2TransformationImpl
+ extends TransformationImpl
+ implements XPath2Transformation {
+
+ /** The filters contained in this <code>XPath2Transformation</code> */
+ private List xPathFilters = new ArrayList();
+
+ /**
+ * Create a new <code>XPath2TransformationImpl</code>.
+ *
+ * The list of XPath-Filter2 expression is initially empty.
+ */
+ public XPath2TransformationImpl() {
+ setAlgorithmURI(XPath2Transformation.XPATH2);
+ }
+
+ /**
+ * @see iaik.server.modules.xml.XPath2Transformation#getXPathFilters()
+ */
+ public List getXPathFilters() {
+ return xPathFilters;
+ }
+
+ /**
+ * Add an XPath-Filter2 expression to the list of filters.
+ *
+ * @param filter The filter to add.
+ */
+ public void addXPathFilter(XPath2Filter filter) {
+ xPathFilters.add(filter);
+ }
+
+ /**
+ * Compare this <code>XPath2Transformation</code> to another.
+ *
+ * @param other The object to compare this
+ * <code>XPath2Transformation</code> to.
+ * @return <code>true</code>, if <code>other</code> is an
+ * <code>XPath2Transformation</code> and <code>getXPathFilters()</code> equals
+ * <code>other.getXPathFilters()</code>. Otherwise <code>false</code> is
+ * returned.
+ * @see java.lang.Object#equals(Object)
+ */
+ public boolean equals(Object other) {
+ if (other instanceof XPath2Transformation) {
+ XPath2Transformation transform = (XPath2Transformation) other;
+
+ return getXPathFilters().equals(transform.getXPathFilters());
+ }
+ return false;
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ Iterator iter = getXPathFilters().iterator();
+ int hashCode = 0;
+
+ while (iter.hasNext()) {
+ hashCode ^= iter.next().hashCode();
+ }
+
+ return hashCode;
+ }
+
+}