01: package freemarker.template;
02:
03: import java.util.Collection;
04: import java.util.Collections;
05: import java.util.Map;
06: import java.util.Set;
07:
08: public class EmptyMap implements Map, Cloneable {
09: public static final EmptyMap instance = new EmptyMap();
10:
11: public void clear() {
12: throw new UnsupportedOperationException(
13: "This Map is read-only.");
14: }
15:
16: public boolean containsKey(Object arg0) {
17: return false;
18: }
19:
20: public boolean containsValue(Object arg0) {
21: return false;
22: }
23:
24: public Set entrySet() {
25: return Collections.EMPTY_SET;
26: }
27:
28: public Object get(Object arg0) {
29: return null;
30: }
31:
32: public boolean isEmpty() {
33: return true;
34: }
35:
36: public Set keySet() {
37: return Collections.EMPTY_SET;
38: }
39:
40: public Object put(Object arg0, Object arg1) {
41: throw new UnsupportedOperationException(
42: "This Map is read-only.");
43: }
44:
45: public void putAll(Map arg0) {
46: throw new UnsupportedOperationException(
47: "This Map is read-only.");
48: }
49:
50: public Object remove(Object arg0) {
51: throw new UnsupportedOperationException(
52: "This Map is read-only.");
53: }
54:
55: public int size() {
56: return 0;
57: }
58:
59: public Collection values() {
60: return Collections.EMPTY_LIST;
61: }
62:
63: }
|