01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.container.om.common;
07:
08: import java.io.Serializable;
09: import java.util.HashMap;
10: import java.util.Iterator;
11: import java.util.Locale;
12: import java.util.Map;
13:
14: import org.apache.pluto.om.common.Description;
15: import org.apache.pluto.om.common.DescriptionSet;
16:
17: /**
18: * Implementation of Apache Pluto object model.
19: * @author Ken Weiner, kweiner@unicon.net
20: * @version $Revision: 34757 $
21: */
22: public class DescriptionSetImpl implements DescriptionSet, Serializable {
23:
24: Map descriptions = null; // Locale --> Description
25:
26: public DescriptionSetImpl() {
27: this .descriptions = new HashMap();
28: }
29:
30: // DescriptionSet methods
31:
32: public Iterator iterator() {
33: return descriptions.values().iterator();
34: }
35:
36: public Description get(Locale locale) {
37: return (Description) descriptions.get(locale);
38: }
39:
40: // Additional methods
41:
42: public void add(String description, Locale locale) {
43: descriptions.put(locale, new DescriptionImpl(description,
44: locale));
45: }
46:
47: public void add(Description description) {
48: descriptions.put(description.getLocale(), description);
49: }
50:
51: }
|