view flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java @ 524:ba238f917b94

The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection. flys-client/trunk@2003 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 25 May 2011 13:42:04 +0000
parents
children 96e60e0a4345
line wrap: on
line source
package de.intevation.flys.client.shared.model;

import java.io.Serializable;

import java.util.List;


/**
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class ThemeList implements Serializable {

    public List<Theme> themes;


    public ThemeList() {
    }


    public ThemeList(List<Theme> themes) {
        this.themes = themes;
    }


    public List<Theme> getThemes() {
        return themes;
    }


    public int getThemeCount() {
        return themes.size();
    }


    /**
     * Returns a theme at a specific position. <b>NOTE: Themes start at position
     * 1. So, take care in loops, that might start at index 0!</b>
     *
     * @param pos The position of the desired theme.
     *
     * @return a theme.
     */
    public Theme getThemeAt(int pos) {
        for (Theme theme: themes) {
            if (theme.getPosition() == pos) {
                return theme;
            }
        }

        return null;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org