ingo@358: package de.intevation.artifactdatabase.state;
ingo@358:
ingo@358: import java.io.Serializable;
ingo@358: import java.util.Set;
ingo@358:
ingo@358: import org.w3c.dom.Node;
ingo@358:
ingo@358:
ingo@358: /**
ingo@358: * @author Ingo Weinzierl
ingo@358: */
ingo@358: public interface Section extends Serializable {
ingo@358:
ingo@358: /**
ingo@359: * Returns an ID for this Section.
ingo@359: *
ingo@359: * @return an ID for this Section.
ingo@359: */
ingo@359: String getId();
ingo@359:
ingo@359: /**
ingo@359: * Adds a new subsection to this Section object.
ingo@359: *
ingo@359: * @param subsection the new Section.
ingo@359: */
ingo@359: void addSubsection(Section subsection);
ingo@359:
ingo@359: /**
ingo@359: * Returns the number of subsections in this Section.
ingo@359: *
ingo@359: * @return the number of subsections.
ingo@359: */
ingo@359: int getSubsectionCount();
ingo@359:
ingo@359: /**
ingo@359: * Returns a subsection at position pos.
ingo@359: *
ingo@359: * @param pos The position of the target subsection.
ingo@359: *
ingo@359: * @return the subsection at position pos.
ingo@359: */
ingo@359: Section getSubsection(int pos);
ingo@359:
ingo@359: /**
ingo@358: * Adds a new Attribute to this Section.
ingo@358: *
ingo@358: * @param key The key that is used to store/retrieve the Attribute.
ingo@358: * @param attribute The new Attribute.
ingo@358: */
ingo@358: void addAttribute(String key, Attribute attribute);
ingo@358:
ingo@358: /**
ingo@358: * Returns an Attribute for the specified key.
ingo@358: *
ingo@358: * @param key The key that is used to retrieve the target Attribute.
ingo@358: *
ingo@358: * @return the Attribute specified by key.
ingo@358: */
ingo@358: Attribute getAttribute(String key);
ingo@358:
ingo@358: /**
ingo@358: * Returns all keys of all Attributes currently stored in this Section.
ingo@358: *
ingo@358: * @return all keys of all Attributes.
ingo@358: */
ingo@358: Set getKeys();
ingo@358:
ingo@358: /**
ingo@358: * Transforms this Section into XML using Attribute.toXML() for each
ingo@359: * Attribute and Section.toXML() for each subsection stored in this Section.
ingo@358: *
ingo@358: * @param parent The parent node.
ingo@358: */
ingo@358: void toXML(Node parent);
ingo@358: }
ingo@358: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :