diff gnv-artifacts/src/main/java/de/intevation/gnv/state/ExtendedInputData.java @ 1119:7c4f81f74c47

merged gnv-artifacts
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:00 +0200
parents f953c9a559d8
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/ExtendedInputData.java	Fri Sep 28 12:14:00 2012 +0200
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2010 by Intevation GmbH
+ *
+ * This program is free software under the LGPL (>=v2.1)
+ * Read the file LGPL.txt coming with the software for details
+ * or visit http://www.gnu.org/licenses/ if it does not exist.
+ */
+
+package de.intevation.gnv.state;
+
+/**
+ * This class is used to save the relation between two attributes. Mainly used
+ * to save the relation between a measurement and the parameter it belongs to.
+ *
+ * @see MeasurementState
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class ExtendedInputData extends DefaultInputData {
+
+    /**
+     * The separater used to separate measurement ids and parameter ids.
+     */
+    public static final String SEPARATOR = ";";
+
+    /**
+     * The parameter this object belongs to.
+     */
+    protected String parameterid;
+
+    /**
+     * Constructcor.
+     *
+     * @param name
+     * @param value
+     * @param object
+     * @param parameterid
+     */
+    public ExtendedInputData(
+        String name,
+        String value,
+        Object object,
+        String parameterid)
+    {
+        super(name, value, object);
+        this.parameterid = parameterid;
+    }
+
+    /**
+     * Return the parameter ids this object belongs to.
+     *
+     * @return the parameter id.
+     */
+    public String getParameterID() {
+        return parameterid;
+    }
+
+    /**
+     * Set the parameter ids.
+     *
+     * @param parameterid Parameter ids.
+     */
+    public void setParameter(String parameterid) {
+        this.parameterid = parameterid;
+    }
+
+    /**
+     * Return all parameter ids as array.
+     *
+     * @return Array of parameter ids.
+     */
+    public String[] splitParameter() {
+        if (parameterid != null)
+            return parameterid.split(SEPARATOR);
+
+        return null;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org