Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java @ 870:d5fb88ba99d2
Display status message and progress information in the WSPLGEN loading panel.
flys-client/trunk@2690 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 09 Sep 2011 15:08:15 +0000 |
parents | 1d0be51ab93b |
children | a7179e3a774e |
line wrap: on
line source
package de.intevation.flys.client.shared.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DataList implements Serializable { /** The list of Data objects managed by this list.*/ protected List<Data> data; /** The name of the state that this list belongs to.*/ protected String state; /** The name of a UIProvider that is recommended to render this DataList.*/ protected String uiprovider; /** The label that should be used to label data objects.*/ protected String label; /** * The default constructor that creates a new DataList without Data objects * and no UIProvider. */ public DataList() { data = new ArrayList<Data>(); } /** * Constructor. * * @param state The name of the state that this list belongs to. * @param size The initial size of the list. */ public DataList(String state, int size) { this.state = state; this.data = new ArrayList<Data>(size); } /** * A constructor that creates a new DataList without Data objects and no * UIProvider. Size defines the initial size of the list. * * @param state The name of the state that this list belongs to. * @param size The initial size of the list. * @param uiprovider The UIProvider that should be used to render this list. */ public DataList(String state, int size, String uiprovider) { this(state, size); this.uiprovider = uiprovider; } /** * A constructor that creates a new DataList without Data objects and no * UIProvider. Size defines the initial size of the list. * * @param state The name of the state that this list belongs to. * @param size The initial size of the list. * @param uiprovider The UIProvider that should be used to render this list. * @param label The label. */ public DataList(String state, int size, String uiprovider, String label) { this(state, size, uiprovider); this.label = label; } /** * Adds a new Data object to the list. * * @param obj The Data object. */ public void add(Data obj) { if (obj != null) { data.add(obj); } } /** * Adds a new Data objects to the list. * * @param obj The Data object. */ public void add(Data[] obj) { if (obj != null) { for (Data o: obj) { data.add(o); } } } /** * Returns the Data element at position <i>idx</i>. * * @param idx The position of an element that should be returned. * * @return the Data element at position <i>idx</i>. */ public Data get(int idx) { if (idx < size()) { return data.get(idx); } return null; } /** * Returns the whole list of Data objects. * * @return the whole list of Data objects. */ public List<Data> getAll() { return data; } /** * Returns the number of Data objects in the list. * * @param the number of Data objects in the list. */ public int size() { return data.size(); } /** * Returns the name of the state that this list belongs to. * * @return the name of the state that this list belongs to. */ public String getState() { return state; } /** * Returns the label for this list. * * @return the label of this list. */ public String getLabel() { return label; } /** * Retrieves the name of a UIProvider or null if no one is recommended. * * @return the name of a UIProvider or null if no one is recommended. */ public String getUIProvider() { return uiprovider; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :