Package org.odmg
Interface DBag
- All Superinterfaces:
Collection,DCollection,Iterable
- All Known Implementing Classes:
RasBag
This interface defines the operations associated with an ODMG bag collection.
All of the operations defined by the JavaSoft
Collection
interface are supported by an ODMG implementation of DBag,
the exception UnsupportedOperationException is not thrown when a
call is made to any of the Collection methods.- Author:
- David Jordan (as Java Editor of the Object Data Management Group)
-
Method Summary
Modifier and TypeMethodDescriptiondifference(DBag otherBag) A newDBaginstance is created that contains the difference of this object and theDBaginstance referenced byotherBag.intersection(DBag otherBag) A newDBaginstance is created that contains the intersection of this object and theDBagreferenced byotherBag.intoccurrences(Object obj) This method returns the number of occurrences of the objectobjin theDBagcollection.A newDBaginstance is created that is the union of this object andotherBag.Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface org.odmg.DCollection
existsElement, query, select, selectElement
-
Method Details
-
union
A newDBaginstance is created that is the union of this object andotherBag. This method is similar to theaddAllmethod inCollection, except that this method creates a new collection andaddAllmodifies the object to contain the result.- Parameters:
otherBag- The other bag to use in the union operation.- Returns:
- A
DBaginstance that contains the union of this object andotherBag.
-
intersection
A newDBaginstance is created that contains the intersection of this object and theDBagreferenced byotherBag. This method is similar to theretainAllmethod inCollection, except that this method creates a new collection andretainAllmodifies the object to contain the result.- Parameters:
otherBag- The other bag to use in creating the intersection.- Returns:
- A
DBaginstance that contains the intersection of this object andotherBag.
-
difference
A newDBaginstance is created that contains the difference of this object and theDBaginstance referenced byotherBag. This method is similar to theremoveAllmethod inCollection, except that this method creates a new collection andremoveAllmodifies the object to contain the result.- 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.
-
occurrences
This method returns the number of occurrences of the objectobjin theDBagcollection.- Parameters:
obj- The value that may have elements in the collection.- Returns:
- The number of occurrences of
objin this collection.
-