-
Notifications
You must be signed in to change notification settings - Fork 0
/
Set.java
40 lines (31 loc) · 913 Bytes
/
Set.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package charset;
public interface Set<E> {
//////////////////////////////////////////////
// for creators, see implementation classes
//////////////////////////////////////////////
// examples of observer methods
/**
* Get size of the set.
* @return the number of elements in this set
*/
public int size();
/**
* Test for membership.
* @param e an element
* @return true iff this set contains e
*/
public boolean contains(E e);
//////////////////////////////////////////////
// examples of mutator methods
/**
* Modifies this set by adding e to the set.
* @param e element to add
*/
public void add(E e);
/**
* Modifies this set by removing e, if found.
* If e is not found in the set, has no effect.
* @param e element to remove
*/
public void remove(E e);
}