public interface MyCollection<E>
Modifier and Type | Method and Description |
---|---|
void |
add(E o)
Add element o into (the end of) the collection.
|
boolean |
contains(E o)
Returns true if this collection contains the specified element.
|
boolean |
isEmpty()
Returns true if this collection contains no elements.
|
void |
remove(E o)
Removes a single instance of the specified element from this
collection, if it is present.
|
int |
size()
Returns the number of elements in this collection.
|
int size()
boolean isEmpty()
boolean contains(E o)
o
- element whose presence in this collection is to be tested. Assume o is not null.void add(E o)
o
- element whose presence in this collection is to be ensured. Assume o is not null.void remove(E o)
o
- element to be removed from this collection, if present. Assume o is not null.