Package org.odmg
Interface DBag
-
- All Superinterfaces:
java.util.Collection,DCollection,java.lang.Iterable
- All Known Implementing Classes:
RasBag
public interface DBag extends DCollection
This interface defines the operations associated with an ODMG bag collection. All of the operations defined by the JavaSoftCollectioninterface are supported by an ODMG implementation ofDBag, the exceptionUnsupportedOperationExceptionis not thrown when a call is made to any of theCollectionmethods.- Author:
- David Jordan (as Java Editor of the Object Data Management Group)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DBagdifference(DBag otherBag)A newDBaginstance is created that contains the difference of this object and theDBaginstance referenced byotherBag.DBagintersection(DBag otherBag)A newDBaginstance is created that contains the intersection of this object and theDBagreferenced byotherBag.intoccurrences(java.lang.Object obj)This method returns the number of occurrences of the objectobjin theDBagcollection.DBagunion(DBag otherBag)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, toArray
-
Methods inherited from interface org.odmg.DCollection
existsElement, query, select, selectElement
-
-
-
-
Method Detail
-
union
DBag union(DBag otherBag)
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
DBag intersection(DBag otherBag)
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
DBag difference(DBag otherBag)
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
int occurrences(java.lang.Object obj)
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.
-
-