1 import java.lang.UnsupportedOperationException;
3 import java.util.Collection;
4 import java.util.HashSet;
5 import java.util.Iterator;
7 import java.util.Spliterator;
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
16 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
20 public final class IoTSet<T> {
23 * Reference to an object Set<T>
28 * Class constructor (pass the reference to this immutable wrapper)
30 protected IoTSet(Set<T> s) {
36 * contains() method inherited from Set interface
38 public boolean contains(T o) {
40 return set.contains(o);
45 * isEmpty() method inherited from Set interface
47 public boolean isEmpty() {
54 * iterator() method inherited from Set interface
56 public Iterator<T> iterator() {
58 return new HashSet<T>(set).iterator();
63 * size() method inherited from Set interface
72 * values() method to return Set object values for easy iteration
74 public Set<T> values() {
76 return new HashSet<T>(set);