comparison 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
comparison
equal deleted inserted replaced
523:0785a8ba5e6d 524:ba238f917b94
1 package de.intevation.flys.client.shared.model;
2
3 import java.io.Serializable;
4
5 import java.util.List;
6
7
8 /**
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
10 */
11 public class ThemeList implements Serializable {
12
13 public List<Theme> themes;
14
15
16 public ThemeList() {
17 }
18
19
20 public ThemeList(List<Theme> themes) {
21 this.themes = themes;
22 }
23
24
25 public List<Theme> getThemes() {
26 return themes;
27 }
28
29
30 public int getThemeCount() {
31 return themes.size();
32 }
33
34
35 /**
36 * Returns a theme at a specific position. <b>NOTE: Themes start at position
37 * 1. So, take care in loops, that might start at index 0!</b>
38 *
39 * @param pos The position of the desired theme.
40 *
41 * @return a theme.
42 */
43 public Theme getThemeAt(int pos) {
44 for (Theme theme: themes) {
45 if (theme.getPosition() == pos) {
46 return theme;
47 }
48 }
49
50 return null;
51 }
52 }
53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org