org.eclipse.emf.ocl.utilities.impl
Class Bag
java.lang.Object
java.util.AbstractCollection
org.eclipse.emf.ocl.utilities.impl.Bag
- All Implemented Interfaces:
- java.util.Collection
- public final class Bag
- extends java.util.AbstractCollection
A Bag is an unordered collection which may have duplicate elements.
Constructor Summary |
Bag()
|
Bag(java.util.Collection c)
|
Method Summary |
boolean |
add(java.lang.Object o)
|
void |
clear()
|
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 |
iterator()
|
boolean |
remove(java.lang.Object o)
removes every occurrence of the object from the collection |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
EMPTY_BAG
public static Bag EMPTY_BAG
Bag
public Bag()
Bag
public Bag(java.util.Collection c)
remove
public boolean remove(java.lang.Object o)
- removes every occurrence of the object from the collection
add
public boolean add(java.lang.Object o)
size
public int size()
clear
public void clear()
equals
public boolean equals(java.lang.Object o)
- Returns true iff this bag and the argument bag have the same number of the same
elements.
hashCode
public int hashCode()
iterator
public java.util.Iterator iterator()
toString
public java.lang.String toString()