1 /***
2 * Java DAB EPG API - Serialize/Deserialize To/From POJOs to XML/Binary as per
3 * ETSI specifications TS 102 818 (XML Specification for DAB EPG) and TS 102
4 * 371 (Transportation and Binary Encoding Specification for EPG).
5 *
6 * Copyright (C) 2007 GCap Media PLC
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 package com.gcapmedia.dab.epg;
23
24 import java.util.Iterator;
25 import java.util.List;
26 import java.util.Locale;
27
28 /***
29 * This contains a set of keywords.
30 */
31 public class Keywords implements Iterable<String> {
32
33 /***
34 * Indicates the language of the keywords
35 */
36 private Locale language;
37
38 /***
39 * Keyword list
40 */
41 private List<String> keywords;
42
43 /***
44 * Create a new keywords group
45 * @param language Indicates the language of the keywords
46 */
47 public Keywords(Locale language) {
48 this.language = language;
49 }
50
51 /***
52 * Add a keyword - this should be in the language specified
53 * @param keyword Keyword to add
54 */
55 public void addKeyword(String keyword) {
56 keywords.add(keyword);
57 }
58
59 /***
60 * Remove a keyword
61 * @param keyword Keyword to remove
62 */
63 public void removeKeyword(String keyword) {
64 keywords.remove(keyword);
65 }
66
67 /***
68 * @return Returns all keywords
69 */
70 public List<String> getKeywords() {
71 return keywords;
72 }
73
74 /***
75 * @return Returns the language of this keyword group (ISO 639)
76 */
77 public String getLanguage() {
78 return language.getLanguage();
79 }
80
81 /***
82 * @see java.lang.Iterable#iterator()
83 */
84 public Iterator<String> iterator() {
85 return keywords.iterator();
86 }
87
88 }