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.window;
07:
08: import java.io.Serializable;
09: import java.util.HashMap;
10: import java.util.Iterator;
11: import java.util.Map;
12:
13: import org.apache.pluto.om.common.ObjectID;
14: import org.apache.pluto.om.window.PortletWindow;
15: import org.apache.pluto.om.window.PortletWindowList;
16: import org.apache.pluto.om.window.PortletWindowListCtrl;
17:
18: /**
19: * Implementation of Apache Pluto object model.
20: * @author Ken Weiner, kweiner@unicon.net
21: * @version $Revision: 34757 $
22: */
23: public class PortletWindowListImpl implements PortletWindowList,
24: PortletWindowListCtrl, Serializable {
25:
26: Map portletWindows = null; // ID --> PortletWindow
27:
28: public PortletWindowListImpl() {
29: portletWindows = new HashMap();
30: }
31:
32: // PortletWindowList methods
33:
34: public Iterator iterator() {
35: return portletWindows.values().iterator();
36: }
37:
38: public PortletWindow get(ObjectID id) {
39: return (PortletWindow) portletWindows.get(id.toString());
40: }
41:
42: // PortletWindowListCtrl methods
43:
44: public void add(PortletWindow window) {
45: portletWindows.put(window.getId().toString(), window);
46: }
47:
48: public void remove(ObjectID id) {
49: portletWindows.remove(id.toString());
50: }
51:
52: }
|