ingo@67: package de.intevation.flys.client.shared.model;
ingo@67:
ingo@67: import java.util.List;
ingo@67:
ingo@67:
ingo@67: /**
ingo@67: * The default implementation of a CollectionItem.
ingo@67: *
ingo@67: * @author Ingo Weinzierl
ingo@67: */
ingo@67: public class DefaultCollectionItem implements CollectionItem {
ingo@67:
ingo@67: /** The identifier that specifies the artifact related to this item.*/
ingo@67: protected String identifier;
ingo@67:
ingo@87: /** The hash that specifies the artifact related to this item.*/
ingo@87: protected String hash;
ingo@87:
ingo@67: /** The list of output modes supported by the artifact of this item.*/
ingo@67: protected List outputModes;
ingo@67:
ingo@67:
ingo@67: /**
ingo@67: * An empty constructor.
ingo@67: */
ingo@67: public DefaultCollectionItem() {
ingo@67: }
ingo@67:
ingo@67:
ingo@67: /**
ingo@67: * The default constructor to create a new CollectionItem related to an
ingo@67: * artifact with output modes.
ingo@67: *
ingo@67: * @param identifier The identifier of an artifact.
ingo@67: * @param outputModes The output modes supported by this item.
ingo@67: */
ingo@87: public DefaultCollectionItem(
ingo@87: String identifier,
ingo@87: String hash,
ingo@87: List modes) {
ingo@67: this.identifier = identifier;
ingo@87: this.hash = hash;
ingo@67: this.outputModes = modes;
ingo@67: }
ingo@67:
ingo@67:
ingo@67: public String identifier() {
ingo@67: return identifier;
ingo@67: }
ingo@67:
ingo@67:
ingo@87: public String hash() {
ingo@87: return hash;
ingo@87: }
ingo@87:
ingo@87:
ingo@67: public List getOutputModes() {
ingo@67: return outputModes;
ingo@67: }
ingo@67:
ingo@67:
ingo@67: public List getFacets(String outputmode) {
ingo@67: for (OutputMode mode: outputModes) {
ingo@67: if (outputmode.equals(mode.getName())) {
ingo@67: // TODO Return facets, but facets are not implemented for
ingo@67: // OutputModes yet!
ingo@67: }
ingo@67: }
ingo@67:
ingo@67: return null;
ingo@67: }
ingo@67: }
ingo@67: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :