2 import java.lang.UnsupportedOperationException;
4 import java.util.Collection;
5 import java.util.HashSet;
6 import java.util.Iterator;
8 import java.util.Spliterator;
11 /** Class IoTSet is the actual implementation of @config IoTSet<...>.
12 * Upon extracting DB information, SetInstrumenter class will use
13 * this class to actually instantiate the Set as IoTSet that uses
14 * Java Set<T> to implement; we don't provide interfaces to modify
15 * the contents, but we do provide means to read them out
17 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
21 public final class IoTSet<T> {
24 * Reference to an object Set<T>
29 * Class constructor (pass the reference to this immutable wrapper)
31 public IoTSet(Set<T> s) {
37 * contains() method inherited from Set interface
39 public boolean contains(T o) {
41 return set.contains(o);
46 * isEmpty() method inherited from Set interface
48 public boolean isEmpty() {
55 * iterator() method inherited from Set interface
57 public Iterator<T> iterator() {
59 return new HashSet<T>(set).iterator();
64 * size() method inherited from Set interface
73 * values() method to return Set object values for easy iteration
75 public Set<T> values() {
77 return new HashSet<T>(set);