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.ArrayList; 25 import java.util.Collection; 26 import java.util.List; 27 28 /*** 29 * An aggregation of all other descriptive elements (text and multimedia): 30 * 31 * <ul> 32 * <li>shortDescription</li> 33 * <li>longDescription</li> 34 * <li>multimedia</li> 35 * </ul> 36 */ 37 public class MediaGroup { 38 39 /*** 40 * Short descriptions 41 */ 42 private List<ShortDescription> shortDescriptions; 43 44 /*** 45 * Long descriptions 46 */ 47 private List<LongDescription> longDescriptions; 48 49 /*** 50 * Multimedia descriptor 51 */ 52 private List<Multimedia> multimedia; 53 54 /*** 55 * Create a new media descriptor 56 */ 57 public MediaGroup() { 58 shortDescriptions = new ArrayList<ShortDescription>(); 59 longDescriptions = new ArrayList<LongDescription>(); 60 multimedia = new ArrayList<Multimedia>(); 61 } 62 63 /*** 64 * @return Returns the short descriptions 65 */ 66 public Collection<ShortDescription> getShortDescriptions() { 67 return shortDescriptions; 68 } 69 70 /*** 71 * Adds a short description 72 * @param shortDescription Short description to add 73 */ 74 public void addShortDescription(String shortDescription) { 75 shortDescriptions.add(new ShortDescription(shortDescription)); 76 } 77 78 /*** 79 * Adds a short description 80 * @param shortDescription Short description to add 81 */ 82 public void addShortDescription(ShortDescription shortDescription) { 83 shortDescriptions.add(shortDescription); 84 } 85 86 /*** 87 * Removes a short description 88 * @param shortDescription Short description to remove 89 */ 90 public void removeShortDescription(ShortDescription shortDescription) { 91 shortDescriptions.remove(shortDescription); 92 } 93 94 /*** 95 * Clears all short descriptions 96 */ 97 public void clearShortDescriptions() { 98 shortDescriptions.clear(); 99 } 100 101 /*** 102 * @return Returns the long descriptions 103 */ 104 public Collection<LongDescription> getLongDescriptions() { 105 return longDescriptions; 106 } 107 108 /*** 109 * Adds a long description 110 * @param longDescription Long description to add 111 */ 112 public void addLongDescription(String longDescription) { 113 longDescriptions.add(new LongDescription(longDescription)); 114 } 115 116 /*** 117 * Adds a long description 118 * @param longDescription Long description to add 119 */ 120 public void addLongDescription(LongDescription longDescription) { 121 longDescriptions.add(longDescription); 122 } 123 124 /*** 125 * Removes a long description 126 * @param longDescription Long description to remove 127 */ 128 public void removeLongDescription(LongDescription longDescription) { 129 longDescriptions.remove(longDescription); 130 } 131 132 /*** 133 * Clears all long descriptions 134 */ 135 public void clearLongDescriptions() { 136 longDescriptions.clear(); 137 } 138 139 /*** 140 * Sets the multimedia descriptor 141 * @param multimedia Multimedia descriptor 142 */ 143 public void addMultimedia(Multimedia item) { 144 multimedia.add(item); 145 } 146 147 /*** 148 * @returns the Multimedia descriptors 149 */ 150 public Collection<Multimedia> getMultimedia() { 151 return multimedia; 152 } 153 154 }