Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java @ 1544:2b3d02626823
Opened Collection interface in preparation of Manual Points-Feature.
flys-client/trunk@3772 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 26 Jan 2012 13:24:17 +0000 |
parents | c899a7ffdc8f |
children | bb9ce9aece70 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java Thu Jan 26 13:21:21 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java Thu Jan 26 13:24:17 2012 +0000 @@ -104,6 +104,7 @@ this.settings = settings; } + /** * Creates a new DefaultCollection with uuid and name. * @@ -169,6 +170,7 @@ } + /** Returns item at index (0-based), or null if out of range. */ public CollectionItem getItem(int idx) { if (idx >= getItemLength()) { return null; @@ -178,6 +180,23 @@ } + /** + * Get item whose identifier is the given string. + * @param uuid identifier of collection item (artifacts uuid). + * @return CollectionItem whose identifier is given String, null if not found. + */ + public CollectionItem getItem(String uuid) { + int size = getItemLength(); + for (int i = 0; i < size; i++) { + CollectionItem item = getItem(i); + if (item.identifier().equals(uuid)) { + return item; + } + } + return null; + } + + public Map<String, OutputMode> getOutputModes() { Map<String, OutputMode> modes = new HashMap<String, OutputMode>();