Interface COM.odi.odmg.Bag

public interface Bag
extends Collection
The Bag interface is a subinterface of the Collection interface. This interface encapsulates the operations on a bag.

All methods in this interface throw the following exceptions:

COM.odi.odmg.TransactionNotInProgressException If there is no transaction in progress.

COM.odi.ObjectStoreException If the current thread is not associated with a transaction or if the current transaction is not associated with the current thread.

Methods that modify persistent objects throw this exception:

COM.odi.odmg.DatabaseIsReadOnlyException If there is a readonly transaction in progress or if the database is open for readonly.

See Also:
BagOfObject

Method Index

 o difference(Bag)
Eqivalent to the ODMG method create_difference().
 o intersection(Bag)
Eqivalent to the ODMG method create_intersection().
 o occurences(Object)
Indicates the number of instances of the specified object in this bag.
 o union(Bag)
Equivalent to the ODMG method create_union().

Methods

 o union
  public abstract Bag union(Bag otherBag)
Equivalent to the ODMG method create_union().

Parameters:
otherBag - The bag with which to form a union.

Returns:
The union between this bag and otherBag.
 o intersection
  public abstract Bag intersection(Bag otherBag)
Eqivalent to the ODMG method create_intersection().

Parameters:
otherBag - The bag with which to form an intersection.

Returns:
The intersection between this bag and otherBag.
 o difference
  public abstract Bag difference(Bag otherBag)
Eqivalent to the ODMG method create_difference().

Parameters:
otherBag - The bag with which to form a difference.

Returns:
The difference between this bag and otherBag.
 o occurences
  public abstract int occurences(Object obj)
Indicates the number of instances of the specified object in this bag. There is no equivalent standard ODMG API.

Parameters:
obj - The object for which to determine the number of instances in this bag.

Returns:
The number of instances of obj in this bag.

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.