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) {
33 //public IoTSet(Set<T> s) {
39 * contains() method inherited from Set interface
41 public boolean contains(T o) {
43 return set.contains(o);
48 * isEmpty() method inherited from Set interface
50 public boolean isEmpty() {
57 * iterator() method inherited from Set interface
59 public Iterator<T> iterator() {
61 return new HashSet<T>(set).iterator();
66 * size() method inherited from Set interface
75 * values() method to return Set object values for easy iteration
77 public Set<T> values() {
79 return new HashSet<T>(set);