1 package iotruntime.slave;
3 import java.io.Serializable;
5 import java.lang.UnsupportedOperationException;
7 import java.util.Collection;
8 import java.util.HashSet;
9 import java.util.Iterator;
11 import java.util.Spliterator;
14 /** Class ISet is another wrapper class of IoTSet that is the
15 * actual implementation of @config IoTSet<...>.
16 * The function is the same as the IoTSet class, but this class
17 * is meant for the class instrumenter to have full access to
18 * our class object. The IoTSet class functions as an immutable
19 * interface to clients/users.
21 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
25 public final class ISet<T> implements Serializable {
28 * Reference to an object Set<T>
33 * Empty class constructor
37 set = new HashSet<T>();
41 * Class constructor (pass the reference to this mutable wrapper)
43 protected ISet(Set<T> s) {
49 * add() method inherited from Set interface
51 public boolean add(T o) {
58 * clear() method inherited from Set interface
67 * contains() method inherited from Set interface
69 public boolean contains(Object o) {
71 return set.contains(o);
76 * isEmpty() method inherited from Set interface
78 public boolean isEmpty() {
85 * iterator() method inherited from Set interface
87 public Iterator<T> iterator() {
89 return set.iterator();
94 * remove() method inherited from Set interface
96 public boolean remove(Object o) {
103 * size() method inherited from Set interface
112 * values() method to return Set object values for easy iteration
114 public Set<T> values() {