Fixing initialization to just create a table on the cloud side.
[iotcloud.git] / version2 / src / java / light_fan_embed_fake_benchmark / IoTSet.java
1 import java.lang.UnsupportedOperationException;
2
3 import java.util.Collection;
4 import java.util.HashSet;
5 import java.util.Iterator;
6 import java.util.Set;
7 import java.util.Spliterator;
8
9
10 /** Class IoTSet is the actual implementation of @config IoTSet<...>.
11  *  Upon extracting DB information, SetInstrumenter class will use
12  *  this class to actually instantiate the Set as IoTSet that uses
13  *  Java Set<T> to implement; we don't provide interfaces to modify
14  *  the contents, but we do provide means to read them out
15  *
16  * @author      Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
17  * @version     1.0
18  * @since       2015-12-01
19  */
20 public final class IoTSet<T> {
21
22         /**
23          * Reference to an object Set<T>
24          */
25         private Set<T> set;
26
27         /**
28          * Class constructor (pass the reference to this immutable wrapper)
29          */
30         protected IoTSet(Set<T> s) {
31
32                 set = s;
33         }
34
35         /**
36          * contains() method inherited from Set interface
37          */
38         public boolean contains(T o) {
39
40                 return set.contains(o);
41
42         }
43
44         /**
45          * isEmpty() method inherited from Set interface
46          */
47         public boolean isEmpty() {
48
49                 return set.isEmpty();
50
51         }
52
53         /**
54          * iterator() method inherited from Set interface
55          */
56         public Iterator<T> iterator() {
57
58                 return new HashSet<T>(set).iterator();
59
60         }
61
62         /**
63          * size() method inherited from Set interface
64          */
65         public int size() {
66
67                 return set.size();
68
69         }
70
71         /**
72          * values() method to return Set object values for easy iteration
73          */
74         public Set<T> values() {
75
76                 return new HashSet<T>(set);
77
78         }
79 }