diff artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/Section.java @ 473:d0ac790a6c89 dive4elements-move

Moved directories to org.dive4elements
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 10:57:18 +0200
parents artifact-database/src/main/java/de/intevation/artifactdatabase/state/Section.java@f93edbfcf2bc
children 415df0fc4fa1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/Section.java	Thu Apr 25 10:57:18 2013 +0200
@@ -0,0 +1,76 @@
+package de.intevation.artifactdatabase.state;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import org.w3c.dom.Node;
+
+
+/**
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface Section extends Serializable {
+
+    /**
+     * Returns an ID for this Section.
+     *
+     * @return an ID for this Section.
+     */
+    String getId();
+
+    /**
+     * Adds a new subsection to this Section object.
+     *
+     * @param subsection the new Section.
+     */
+    void addSubsection(Section subsection);
+
+    /**
+     * Returns the number of subsections in this Section.
+     *
+     * @return the number of subsections.
+     */
+    int getSubsectionCount();
+
+    /**
+     * Returns a subsection at position <i>pos</i>.
+     *
+     * @param pos The position of the target subsection.
+     *
+     * @return the subsection at position <i>pos</i>.
+     */
+    Section getSubsection(int pos);
+
+    /**
+     * Adds a new Attribute to this Section.
+     *
+     * @param key The key that is used to store/retrieve the Attribute.
+     * @param attribute The new Attribute.
+     */
+    void addAttribute(String key, Attribute attribute);
+
+    /**
+     * Returns an Attribute for the specified <i>key</i>.
+     *
+     * @param key The key that is used to retrieve the target Attribute.
+     *
+     * @return the Attribute specified by <i>key</i>.
+     */
+    Attribute getAttribute(String key);
+
+    /**
+     * Returns all keys of all Attributes currently stored in this Section.
+     *
+     * @return all keys of all Attributes.
+     */
+    Set<String> getKeys();
+
+    /**
+     * Transforms this Section into XML using Attribute.toXML() for each
+     * Attribute and Section.toXML() for each subsection stored in this Section.
+     *
+     * @param parent The parent node.
+     */
+    void toXML(Node parent);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org