- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleSet.java
More file actions
Latest commit
25 lines (24 loc) · 711 Bytes
/
Copy pathSimpleSet.java
File metadata and controls
25 lines (24 loc) · 711 Bytes
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
publicinterfaceSimpleSet {
/**
* Add a specified element to the set if it's not already in it.
* @param newValue New value to add to the set
* @return False iff newValue already exists in the set
*/
booleanadd(StringnewValue);
/**
* Look for a specified value in the set.
* @param searchVal Value to search for
* @return True iff searchVal is found in the set
*/
booleancontains(StringsearchVal);
/**
* Remove the input element from the set.
* @param toDelete Value to delete
* @return True iff toDelete is found and deleted
*/
booleandelete(StringtoDelete);
/**
* @return The number of elements currently in the set
*/
publicintsize();
}