Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java @ 17:6cb8aff3cd6b
Enhanced the Collection and its default implementation.
flys-client/trunk@1330 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 18 Feb 2011 15:40:04 +0000 |
parents | 14bf7895a2ec |
children | 74257b95567b |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java Fri Feb 18 14:23:12 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java Fri Feb 18 15:40:04 2011 +0000 @@ -1,6 +1,8 @@ package de.intevation.flys.client.shared.model; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** @@ -13,6 +15,9 @@ /** The uuid of the collection. */ protected String uuid; + /** The list of artifacts that are managed by this Collection.*/ + protected List<Artifact> artifacts; + /** * Creates a new DefaultCollection with a UUID. @@ -20,7 +25,8 @@ * @param uuid The UUID. */ public DefaultCollection(String uuid) { - this.uuid = uuid; + this.uuid = uuid; + this.artifacts = new ArrayList<Artifact>(); } @@ -37,5 +43,22 @@ public String getName() { return uuid; } + + + public void addArtifact(Artifact artifact) { + if (artifact != null) { + artifacts.add(artifact); + } + } + + + public int getArtifactLength() { + return artifacts.size(); + } + + + public Artifact getArtifact(int idx) { + return artifacts.get(idx); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :