Package rasj.odmg
Class RasBag
- java.lang.Object
-
- java.util.AbstractCollection
-
- rasj.odmg.RasCollection
-
- rasj.odmg.RasBag
-
- All Implemented Interfaces:
java.lang.Iterable,java.util.Collection,DBag,DCollection
public class RasBag extends RasCollection implements DBag
This class implements the ODMG DBag interface.
-
-
Constructor Summary
Constructors Constructor Description RasBag()constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.Object o)Appends the specified element to this Bag.DBagdifference(DBag otherBag)A new DBag instance is created that contains the difference of this object and the DBag instance referenced by otherBag.DBagintersection(DBag otherBag)A new DBag instance is created that contains the intersection of this object and the DBag referenced by otherBag.java.util.Iteratoriterator()Returns an iterator over the elements in this Bag in proper sequence.intoccurrences(java.lang.Object obj)This method returns the number of occurrences of the object obj in the DBag collection.intsize()Returns the number of elements in this Bag.DBagunion(DBag otherBag)A new DBag instance is created that is the union of this object and otherBag.-
Methods inherited from class rasj.odmg.RasCollection
existsElement, query, select, selectElement
-
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.odmg.DCollection
existsElement, query, select, selectElement
-
-
-
-
Method Detail
-
add
public boolean add(java.lang.Object o)
Appends the specified element to this Bag.- Specified by:
addin interfacejava.util.Collection- Overrides:
addin classjava.util.AbstractCollection
-
occurrences
public int occurrences(java.lang.Object obj)
This method returns the number of occurrences of the object obj in the DBag collection.- Specified by:
occurrencesin interfaceDBag- Parameters:
obj- The value that may have elements in the collection.- Returns:
- The number of occurrences of
objin this collection.
-
difference
public DBag difference(DBag otherBag)
A new DBag instance is created that contains the difference of this object and the DBag instance referenced by otherBag.- Specified by:
differencein interfaceDBag- Parameters:
otherBag- The other bag to use in creating the difference.- Returns:
- A
DBaginstance that contains the elements of this object minus the elements inotherBag.
-
intersection
public DBag intersection(DBag otherBag)
A new DBag instance is created that contains the intersection of this object and the DBag referenced by otherBag.- Specified by:
intersectionin interfaceDBag- Parameters:
otherBag- The other bag to use in creating the intersection.- Returns:
- A
DBaginstance that contains the intersection of this object andotherBag.
-
union
public DBag union(DBag otherBag)
A new DBag instance is created that is the union of this object and otherBag.
-
iterator
public java.util.Iterator iterator()
Returns an iterator over the elements in this Bag in proper sequence.- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Overrides:
iteratorin classRasCollection
-
size
public int size()
Returns the number of elements in this Bag.- Specified by:
sizein interfacejava.util.Collection- Overrides:
sizein classRasCollection
-
-