001 /*
002 Galois, a framework to exploit amorphous data-parallelism in irregular
003 programs.
004
005 Copyright (C) 2010, The University of Texas at Austin. All rights reserved.
006 UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS SOFTWARE
007 AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR ANY
008 PARTICULAR PURPOSE, NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY
009 WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
010 NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF THE
011 SOFTWARE OR DOCUMENTATION. Under no circumstances shall University be liable
012 for incidental, special, indirect, direct or consequential damages or loss of
013 profits, interruption of business, or related expenses which may arise from use
014 of Software or Documentation, including but not limited to those resulting from
015 defects in Software and/or Documentation, or loss or inaccuracy of data of any
016 kind.
017
018 File: GSet.java
019
020 */
021
022 package galois.objects;
023
024 import java.util.Collection;
025 import java.util.Iterator;
026 import java.util.Set;
027
028 /**
029 * A set of elements.
030 *
031 *
032 * @param <E> type of elements in set
033 * @see Set
034 */
035 public interface GSet<E extends Lockable> extends Set<E> {
036 @Override
037 public boolean add(E e);
038
039 /**
040 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
041 * upon invocation of this method. See {@link galois.objects.MethodFlag}
042 * @see #add(Lockable)
043 */
044 public boolean add(E e, byte flags);
045
046 @Override
047 public boolean addAll(Collection<? extends E> c);
048
049 /**
050 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
051 * upon invocation of this method. See {@link galois.objects.MethodFlag}
052 * @see #addAll(Collection)
053 */
054 public boolean addAll(Collection<? extends E> c, byte flags);
055
056 @Override
057 public void clear();
058
059 /**
060 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
061 * upon invocation of this method. See {@link galois.objects.MethodFlag}
062 * @see #clear()
063 */
064 public void clear(byte flags);
065
066 @Override
067 public boolean contains(Object o);
068
069 /**
070 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
071 * upon invocation of this method. See {@link galois.objects.MethodFlag}
072 * @see #contains(Object)
073 */
074 public boolean contains(Object o, byte flags);
075
076 @Override
077 public boolean containsAll(Collection<?> c);
078
079 /**
080 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
081 * upon invocation of this method. See {@link galois.objects.MethodFlag}
082 * @see #containsAll(Collection)
083 */
084 public boolean containsAll(Collection<?> c, byte flags);
085
086 @Override
087 public boolean equals(Object o);
088
089 /**
090 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
091 * upon invocation of this method. See {@link galois.objects.MethodFlag}
092 * @see #equals(Object)
093 */
094 public boolean equals(Object o, byte flags);
095
096 @Override
097 public int hashCode();
098
099 /**
100 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
101 * upon invocation of this method. See {@link galois.objects.MethodFlag}
102 * @see #hashCode()
103 */
104 public int hashCode(byte flags);
105
106 @Override
107 public boolean isEmpty();
108
109 /**
110 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
111 * upon invocation of this method. See {@link galois.objects.MethodFlag}
112 * @see #isEmpty()
113 */
114 public boolean isEmpty(byte flags);
115
116 @Override
117 public Iterator<E> iterator();
118
119 /**
120 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
121 * upon invocation of this method. See {@link galois.objects.MethodFlag}
122 * @see #iterator()
123 */
124 public Iterator<E> iterator(byte flags);
125
126 @Override
127 public boolean remove(Object o);
128
129 /**
130 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
131 * upon invocation of this method. See {@link galois.objects.MethodFlag}
132 * @see #remove(Object)
133 */
134 public boolean remove(Object o, byte flags);
135
136 @Override
137 public boolean removeAll(Collection<?> c);
138
139 /**
140 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
141 * upon invocation of this method. See {@link galois.objects.MethodFlag}
142 * @see #removeAll(Collection)
143 */
144 public boolean removeAll(Collection<?> c, byte flags);
145
146 @Override
147 public boolean retainAll(Collection<?> c);
148
149 /**
150 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
151 * upon invocation of this method. See {@link galois.objects.MethodFlag}
152 * @see #retainAll(Collection)
153 */
154 public boolean retainAll(Collection<?> c, byte flags);
155
156 @Override
157 public int size();
158
159 /**
160 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
161 * upon invocation of this method. See {@link galois.objects.MethodFlag}
162 * @see #size()
163 */
164 public int size(byte flags);
165
166 @Override
167 public Object[] toArray();
168
169 /**
170 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
171 * upon invocation of this method. See {@link galois.objects.MethodFlag}
172 * @see #toArray()
173 */
174 public Object[] toArray(byte flags);
175
176 @Override
177 public <T> T[] toArray(T[] a);
178
179 /**
180 * @param flags Galois runtime actions (e.g., conflict detection) that need to be executed
181 * upon invocation of this method. See {@link galois.objects.MethodFlag}
182 * @see #toArray(Object[])
183 */
184 public <T> T[] toArray(T[] a, byte flags);
185 }