-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathDiamondIterableMapMRO.java
More file actions
108 lines (84 loc) · 2.28 KB
/
Copy pathDiamondIterableMapMRO.java
File metadata and controls
108 lines (84 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// example from Storm and its use of Clojure
package javatests;
import java.io.Serializable;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import org.python.util.Generic;
// The following tag interfaces duplicate the interface/abstract class supertypes of
// Storm's IndifferentAccessMap, including Clojure types
interface Seqable {}
interface IPersistentCollection extends Seqable {}
interface ILookup {}
interface Associative extends IPersistentCollection, ILookup {}
interface Counted {}
interface IPersistentMap extends Iterable, Associative, Counted {}
abstract class AFn implements IFn {}
interface IFn extends Callable, Runnable {}
public class DiamondIterableMapMRO extends AFn implements ILookup, IPersistentMap, Map {
private final Map backing;
public DiamondIterableMapMRO() {
backing = Generic.map();
}
public Object call() { return null; }
public void run() {}
public Iterator iterator() {
return backing.keySet().iterator();
}
public Set entrySet() {
return backing.entrySet();
}
@Override
public boolean equals(Object o) {
return backing.equals(o);
}
@Override
public int hashCode() {
return backing.hashCode();
}
@Override
public int size() {
return backing.size();
}
@Override
public boolean isEmpty() {
return backing.isEmpty();
}
@Override
public boolean containsKey(Object key) {
return backing.containsKey(key);
}
@Override
public boolean containsValue(Object value) {
return backing.containsValue(value);
}
@Override
public Object get(Object key) {
return backing.get(key);
}
public Object put(Object key, Object value) {
return backing.put(key, value);
}
@Override
public Object remove(Object key) {
return backing.remove(key);
}
public void putAll(Map m) {
backing.putAll(m);
}
@Override
public void clear() {
backing.clear();
}
@Override
public Set keySet() {
return backing.keySet();
}
@Override
public Collection values() {
return backing.values();
}
}