1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto.portalImpl.om.window.impl;
21
22 import java.util.*;
23 import org.apache.pluto.om.window.*;
24 import org.apache.pluto.om.common.ObjectID;
25
26 public class PortletWindowListImpl implements PortletWindowList, PortletWindowListCtrl {
27
28
29 HashMap windows = null;
30
31 public PortletWindowListImpl() {
32 windows = new HashMap();
33 }
34
35
36
37 /***
38 * Returns the elements of this set
39 *
40 * @return An iterator containg all elements
41 */
42 public java.util.Iterator iterator() {
43
44 return windows.values().iterator();
45 }
46
47
48 /***
49 * Returns the portlet window object of the given id
50 *
51 * @param id the window id.
52 *
53 * @return the portlet window object or null if the list does not
54 * contain a portlet window with the given id
55 **/
56 public PortletWindow get(ObjectID id)
57 {
58 return (PortletWindow)windows.get(id.toString());
59 }
60
61
62
63 /***
64 * Add a portlet window to the list
65 *
66 * @param window the porlet window to add
67 **/
68 public void add(PortletWindow window) {
69 if(window != null) {
70 windows.put(window.getId().toString(), window);
71 }
72 }
73
74 /***
75 * Remove the portlet window with the given Id from the list
76 *
77 * @param id the Id of the portlet window which should be removed
78 **/
79 public void remove(ObjectID id){
80 if(id != null) {
81 windows.remove(id.toString());
82 }
83 }
84 }