KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > proxy > MapProxy


1 //$Id: MapProxy.java,v 1.3 2005/02/12 07:19:45 steveebersole Exp $
2
package org.hibernate.proxy;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.Collection JavaDoc;
6 import java.util.Map JavaDoc;
7 import java.util.Set JavaDoc;
8
9 /**
10  * Proxy for "dynamic-map" entity representations.
11  *
12  * @author Gavin King
13  */

14 public class MapProxy implements HibernateProxy, Map JavaDoc, Serializable JavaDoc {
15
16     private MapLazyInitializer li;
17
18     MapProxy(MapLazyInitializer li) {
19         this.li = li;
20     }
21
22     public Object JavaDoc writeReplace() {
23         return this;
24     }
25
26     public LazyInitializer getHibernateLazyInitializer() {
27         return li;
28     }
29
30     public int size() {
31         return li.getMap().size();
32     }
33
34     public void clear() {
35         li.getMap().clear();
36     }
37
38     public boolean isEmpty() {
39         return li.getMap().isEmpty();
40     }
41
42     public boolean containsKey(Object JavaDoc key) {
43         return li.getMap().containsKey(key);
44     }
45
46     public boolean containsValue(Object JavaDoc value) {
47         return li.getMap().containsValue(value);
48     }
49
50     public Collection JavaDoc values() {
51         return li.getMap().values();
52     }
53
54     public void putAll(Map JavaDoc t) {
55         li.getMap().putAll(t);
56     }
57
58     public Set JavaDoc entrySet() {
59         return li.getMap().entrySet();
60     }
61
62     public Set JavaDoc keySet() {
63         return li.getMap().keySet();
64     }
65
66     public Object JavaDoc get(Object JavaDoc key) {
67         return li.getMap().get(key);
68     }
69
70     public Object JavaDoc remove(Object JavaDoc key) {
71         return li.getMap().remove(key);
72     }
73
74     public Object JavaDoc put(Object JavaDoc key, Object JavaDoc value) {
75         return li.getMap().put(key, value);
76     }
77
78 }
79
Popular Tags