org.eclipse.emf.ocl.utilities.impl
Class Bag
java.lang.Object
java.util.AbstractCollection
org.eclipse.emf.ocl.utilities.impl.Bag
- All Implemented Interfaces:
- Iterable, Collection
public final class Bag
- extends AbstractCollection
A Bag is an unordered collection which may have duplicate elements.
EMPTY_BAG
public static Bag EMPTY_BAG
Bag
public Bag()
Bag
public Bag(Collection c)
remove
public boolean remove(Object o)
- removes every occurrence of the object from the collection
- Specified by:
remove in interface Collection- Overrides:
remove in class AbstractCollection
add
public boolean add(Object o)
- Specified by:
add in interface Collection- Overrides:
add in class AbstractCollection
size
public int size()
- Specified by:
size in interface Collection- Specified by:
size in class AbstractCollection
clear
public void clear()
- Specified by:
clear in interface Collection- Overrides:
clear in class AbstractCollection
equals
public boolean equals(Object o)
- Returns true iff this bag and the argument bag have the same number of the same
elements.
- Specified by:
equals in interface Collection- Overrides:
equals in class Object
hashCode
public int hashCode()
- Specified by:
hashCode in interface Collection- Overrides:
hashCode in class Object
iterator
public Iterator iterator()
- Specified by:
iterator in interface Iterable- Specified by:
iterator in interface Collection- Specified by:
iterator in class AbstractCollection
toString
public String toString()
- Overrides:
toString in class AbstractCollection