| Constructor and Description |
|---|
BagImpl() |
BagImpl(java.util.Collection<? extends E> c) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
int |
count(java.lang.Object o)
Queries how many times the specified object occurs in me.
|
static <E> Bag<E> |
emptyBag() |
boolean |
equals(java.lang.Object o)
Returns true iff this bag and the argument bag have the same number of the same
elements.
|
int |
hashCode() |
java.util.Iterator<E> |
iterator() |
boolean |
remove(java.lang.Object o)
removes every occurrence of the object from the collection
|
int |
size() |
java.lang.String |
toString() |
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArraypublic static Bag<?> EMPTY_BAG
public BagImpl()
public BagImpl(java.util.Collection<? extends E> c)
public static <E> Bag<E> emptyBag()
public boolean remove(java.lang.Object o)
public boolean add(E o)
public boolean contains(java.lang.Object o)
public int count(java.lang.Object o)
Bagpublic int size()
public void clear()
public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<E>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<E>hashCode in class java.lang.Objectpublic java.util.Iterator<E> iterator()
public java.lang.String toString()
toString in class java.util.AbstractCollection<E>