diff --git a/src/edu/caltech/cs2/interfaces/ISet.java b/src/edu/caltech/cs2/interfaces/ISet.java index c99dcdea2ad5bc57f34ef698f54ae48d2215b5da..61e179ec8509f79aa3a56e90d8caa7f20917b7f6 100644 --- a/src/edu/caltech/cs2/interfaces/ISet.java +++ b/src/edu/caltech/cs2/interfaces/ISet.java @@ -79,7 +79,7 @@ public class ISet<E> implements Iterable<E> { * element */ public boolean add(E e) { - return this.internalDictionary.put(e, new Object()) != null; + return this.internalDictionary.put(e, new Object()) == null; } @@ -100,17 +100,6 @@ public class ISet<E> implements Iterable<E> { return this.internalDictionary.remove(e) != null; } - /** - * Removes all of the elements from this set (optional operation). - * The set will be empty after this call returns. - * - * @throws UnsupportedOperationException if the {@code clear} method - * is not supported by this set - */ - public void clear() { - throw new UnsupportedOperationException(); - } - @Override public String toString() { StringBuilder b = new StringBuilder();