Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java @ 4241:49cb65d5932d
Improved the historical discharge calculation.
The calculation now creates new HistoricalWQKms (new subclass of WQKms). Those WQKms are used
to create new facets from (new) type 'HistoricalDischargeCurveFacet'. The chart generator is
improved to support those facets.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Oct 2012 14:34:35 +0200 |
parents | 92074508a387 |
children |
line wrap: on
line source
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 { /** 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)) { styles.remove(i); } } } /** * 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); if (tmp.getFacet().equals(facet) && tmp.getIndex() == index) { return tmp; } } 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; } }