Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java @ 1285:0f3b19df1880
Added new service and model for collection item attributes.
flys-client/trunk@2871 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 30 Sep 2011 10:57:56 +0000 |
parents | |
children | bdc270ea6195 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java Fri Sep 30 10:57:56 2011 +0000 @@ -0,0 +1,48 @@ +package de.intevation.flys.client.shared.model; + +import java.io.Serializable; + +import java.util.List; +import java.util.ArrayList; + + +/** + * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> + */ +public class CollectionItemAttribute implements Serializable { + + protected List<Style> styles; + + public CollectionItemAttribute() { + styles = new ArrayList<Style>(); + } + + public void appendStyle (Style style) { + this.styles.add(style); + } + + public void removeStyle (String name) { + for (int i = 0; i < styles.size(); i++) { + if (styles.get(i).getName().equals(name)) { + styles.remove(i); + } + } + } + + public Style getStyle(String name) { + for (int i = 0; i < styles.size(); i++) { + if (styles.get(i).getName().equals(name)) { + return styles.get(i); + } + } + return null; + } + + public Style getStyle(int i) { + return styles.get(i); + } + + public int getNumStyles() { + return styles.size(); + } +}