KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > management > browser > frame > ResourceIndexer


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.management.browser.frame;
8
9 import org.ejtools.adwt.util.DefaultObjectIndexer;
10 import org.ejtools.management.browser.model.ManagedObject;
11
12 /**
13  * @author Laurent Etiemble
14  * @version $Revision: 1.1 $
15  */

16 public class ResourceIndexer extends DefaultObjectIndexer
17 {
18    /**
19     * Description of the Method
20     *
21     * @param key Description of the Parameter
22     * @param value Description of the Parameter
23     * @return Description of the Return Value
24     */

25    public Object JavaDoc put(Object JavaDoc key, Object JavaDoc value)
26    {
27       if (key instanceof ManagedObject)
28       {
29          return super.put(((ManagedObject) key).getCanonicalName(), value);
30       }
31       return super.put(key, value);
32    }
33
34
35    /**
36     * Description of the Method
37     *
38     * @param key Description of the Parameter
39     * @return Description of the Return Value
40     */

41    public Object JavaDoc remove(Object JavaDoc key)
42    {
43       if (key instanceof ManagedObject)
44       {
45          return super.remove(((ManagedObject) key).getCanonicalName());
46       }
47       return super.remove(key);
48    }
49 }
50
Popular Tags