A Set is a data structure which does not allow duplicate elements. @since 1.2
| 24 | * @since 1.2 |
| 25 | */ |
| 26 | public interface Set<E> extends Collection<E> { |
| 27 | |
| 28 | /** |
| 29 | * Adds the specified object to this set. The set is not modified if it |
| 30 | * already contains the object. |
| 31 | * |
| 32 | * @param object |
| 33 | * the object to add. |
| 34 | * @return {@code true} if this set is modified, {@code false} otherwise. |
| 35 | * @throws UnsupportedOperationException |
| 36 | * when adding to this set is not supported. |
| 37 | * @throws ClassCastException |
| 38 | * when the class of the object is inappropriate for this set. |
| 39 | * @throws IllegalArgumentException |
| 40 | * when the object cannot be added to this set. |
| 41 | */ |
| 42 | public boolean add(E object); |
| 43 | |
| 44 | /** |
| 45 | * Adds the objects in the specified collection which do not exist yet in |
| 46 | * this set. |
| 47 | * |
| 48 | * @param collection |
| 49 | * the collection of objects. |
| 50 | * @return {@code true} if this set is modified, {@code false} otherwise. |
| 51 | * @throws UnsupportedOperationException |
| 52 | * when adding to this set is not supported. |
| 53 | * @throws ClassCastException |
| 54 | * when the class of an object is inappropriate for this set. |
| 55 | * @throws IllegalArgumentException |
| 56 | * when an object cannot be added to this set. |
| 57 | */ |
| 58 | public boolean addAll(Collection<? extends E> collection); |
| 59 | |
| 60 | /** |
| 61 | * Removes all elements from this set, leaving it empty. |
| 62 | * |
| 63 | * @throws UnsupportedOperationException |
| 64 | * when removing from this set is not supported. |
| 65 | * @see #isEmpty |
| 66 | * @see #size |
| 67 | */ |
| 68 | public void clear(); |
| 69 | |
| 70 | /** |
| 71 | * Searches this set for the specified object. |
| 72 | * |
| 73 | * @param object |
| 74 | * the object to search for. |
| 75 | * @return {@code true} if object is an element of this set, {@code false} |
| 76 | * otherwise. |
| 77 | */ |
| 78 | public boolean contains(Object object); |
| 79 | |
| 80 | /** |
| 81 | * Searches this set for all objects in the specified collection. |
| 82 | * |
| 83 | * @param collection |
no outgoing calls
no test coverage detected