public interface SimpleBagInterface<T>
Modifier and Type | Method and Description |
---|---|
boolean |
add(T newEntry)
Adds a new entry to this bag.
|
int |
getCurrentSize()
Gets the current number of entries in this bag.
|
boolean |
isEmpty()
Sees whether this bag is empty.
|
T |
pick()
returns a random entry without removing from the bag.
|
boolean |
remove(T anEntry)
Removes one occurrence of a given entry from this bag.
|
int getCurrentSize()
boolean isEmpty()
boolean add(T newEntry)
newEntry
- The object to be added as a new entry.boolean remove(T anEntry)
anEntry
- The entry to be removed.T pick()