uk.ac.ucl.cs.emofocl.jmi.reflect.extended
Class Bag
java.lang.Object
uk.ac.ucl.cs.emofocl.jmi.reflect.extended.OCLCollection
uk.ac.ucl.cs.emofocl.jmi.reflect.extended.Bag
- All Implemented Interfaces:
- Iterable, Collection
public class Bag
- extends OCLCollection
- implements Collection
TODO: Rewrite to use HashSet as underlying container.
- Author:
- James
Bag
public Bag(CollectionType type,
int lower,
int upper)
Bag
public Bag(Type elementType)
size
public int size()
- Specified by:
size
in interface Collection
- Specified by:
size
in class OCLCollection
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection
iterator
public Iterator iterator()
- Specified by:
iterator
in interface Iterable
- Specified by:
iterator
in interface Collection
- Specified by:
iterator
in class OCLCollection
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection
toArray
public Object[] toArray(Object[] arg0)
- Specified by:
toArray
in interface Collection
add
public boolean add(Object o)
- Specified by:
add
in interface Collection
- Overrides:
add
in class OCLCollection
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection
- Overrides:
remove
in class OCLCollection
containsAll
public boolean containsAll(Collection arg0)
- Specified by:
containsAll
in interface Collection
addAll
public boolean addAll(Collection collection)
- Specified by:
addAll
in interface Collection
removeAll
public boolean removeAll(Collection collection)
- Specified by:
removeAll
in interface Collection
retainAll
public boolean retainAll(Collection collection)
- Specified by:
retainAll
in interface Collection
clear
public void clear()
- Specified by:
clear
in interface Collection
quickSort
protected static void quickSort(int[] unsorted)
quickSort
protected static void quickSort(int[] unsorted,
int l,
int h,
int[] lower,
int[] higher)
extHashValue
public int extHashValue()
- Specified by:
extHashValue
in class OCLCollection
extEquals
public boolean extEquals(Object other)
- Specified by:
extEquals
in class OCLCollection
equals
public boolean equals(Object other)
- Equal if all contents are equal and present in identical quantities.
- Specified by:
equals
in interface Collection
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object