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 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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DBag difference​(DBag otherBag)
      A new DBag instance is created that contains the difference of this object and the DBag instance referenced by otherBag.
      DBag intersection​(DBag otherBag)
      A new DBag instance is created that contains the intersection of this object and the DBag referenced by otherBag.
      int occurrences​(java.lang.Object obj)
      This method returns the number of occurrences of the object obj in the DBag collection.
      DBag union​(DBag otherBag)
      A new DBag instance is created that is the union of this object and otherBag.
      • 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 java.lang.Iterable

        forEach
    • Method Detail

      • union

        DBag union​(DBag otherBag)
        A new DBag instance is created that is the union of this object and otherBag. This method is similar to the addAll method in Collection, except that this method creates a new collection and addAll modifies the object to contain the result.
        Parameters:
        otherBag - The other bag to use in the union operation.
        Returns:
        A DBag instance that contains the union of this object and otherBag.
      • intersection

        DBag intersection​(DBag otherBag)
        A new DBag instance is created that contains the intersection of this object and the DBag referenced by otherBag. This method is similar to the retainAll method in Collection, except that this method creates a new collection and retainAll modifies the object to contain the result.
        Parameters:
        otherBag - The other bag to use in creating the intersection.
        Returns:
        A DBag instance that contains the intersection of this object and otherBag.
      • difference

        DBag difference​(DBag otherBag)
        A new DBag instance is created that contains the difference of this object and the DBag instance referenced by otherBag. This method is similar to the removeAll method in Collection, except that this method creates a new collection and removeAll modifies the object to contain the result.
        Parameters:
        otherBag - The other bag to use in creating the difference.
        Returns:
        A DBag instance that contains the elements of this object minus the elements in otherBag.
      • occurrences

        int occurrences​(java.lang.Object obj)
        This method returns the number of occurrences of the object obj in the DBag collection.
        Parameters:
        obj - The value that may have elements in the collection.
        Returns:
        The number of occurrences of obj in this collection.