1 package iotruntime.slave;
3 import java.lang.UnsupportedOperationException;
5 import java.util.Collection;
6 import java.util.HashSet;
7 import java.util.Iterator;
9 import java.util.Spliterator;
12 /** Class IoTSet is the actual implementation of @config IoTSet<...>.
13 * Upon extracting DB information, SetInstrumenter class will use
14 * this class to actually instantiate the Set as IoTSet that uses
15 * Java Set<T> to implement; we don't provide interfaces to modify
16 * the contents, but we do provide means to read them out
18 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
22 public final class IoTSet<T> {
25 * Reference to an object Set<T>
30 * Class constructor (pass the reference to this immutable wrapper)
32 protected IoTSet(Set<T> s) {
38 * contains() method inherited from Set interface
40 public boolean contains(T o) {
42 return set.contains(o);
47 * isEmpty() method inherited from Set interface
49 public boolean isEmpty() {
56 * iterator() method inherited from Set interface
58 public Iterator<T> iterator() {
60 return new HashSet<T>(set).iterator();
65 * size() method inherited from Set interface
74 * values() method to return Set object values for easy iteration
76 public Set<T> values() {
78 return new HashSet<T>(set);