Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java @ 1345:92074508a387
Added documentation.
flys-client/trunk@3003 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 18 Oct 2011 12:33:23 +0000 |
parents | 974c6b3700de |
children |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java Mon Oct 17 17:33:27 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java Tue Oct 18 12:33:23 2011 +0000 @@ -11,18 +11,34 @@ */ public class CollectionItemAttribute implements Serializable { + /** The list of styles. */ protected List<Style> styles; + /** The artifact. */ protected String artifact; + + /** + * Creates a new CollectionItem Attribute. + */ public CollectionItemAttribute() { styles = new ArrayList<Style>(); } + + /** + * Append a new Style. + * @param style The style. + */ public void appendStyle (Style style) { this.styles.add(style); } + + /** + * Remove a style from the attributes. + * @param name The style name. + */ public void removeStyle (String name) { for (int i = 0; i < styles.size(); i++) { if (styles.get(i).getName().equals(name)) { @@ -31,6 +47,14 @@ } } + + /** + * Get a style from the collection item. + * @param facet The facet this style belongs to. + * @param index The style index. + * + * @return The selected style or 'null'. + */ public Style getStyle(String facet, int index) { for (int i = 0; i < styles.size(); i++) { Style tmp = styles.get(i); @@ -42,18 +66,40 @@ return null; } + + /** + * Get the style at a postion. + * @param i The position index. + * + * @return The selected style. + */ public Style getStyle(int i) { return styles.get(i); } + + /** + * Get the number of styles. + * @return The number of styles. + */ public int getNumStyles() { return styles.size(); } + + /** + * Set the current artifact. + * @param The artifact uuid. + */ public void setArtifact(String artifact) { this.artifact = artifact; } + + /** + * Get the associated artifact. + * @return The artifact. + */ public String getArtifact () { return this.artifact; }