Package rasj.odmg
Class RasBag
java.lang.Object
java.util.AbstractCollection
rasj.odmg.RasCollection
rasj.odmg.RasBag
- All Implemented Interfaces:
Iterable,Collection,DBag,DCollection
This class implements the ODMG DBag interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAppends the specified element to this Bag.difference(DBag otherBag) A new DBag instance is created that contains the difference of this object and the DBag instance referenced by otherBag.intersection(DBag otherBag) A new DBag instance is created that contains the intersection of this object and the DBag referenced by otherBag.iterator()Returns an iterator over the elements in this Bag in proper sequence.intoccurrences(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.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, selectElementMethods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface org.odmg.DCollection
existsElement, query, select, selectElement
-
Constructor Details
-
RasBag
public RasBag()constructor
-
-
Method Details
-
add
Appends the specified element to this Bag.- Specified by:
addin interfaceCollection- Overrides:
addin classAbstractCollection
-
occurrences
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
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
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
A new DBag instance is created that is the union of this object and otherBag. -
iterator
Returns an iterator over the elements in this Bag in proper sequence.- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable- Overrides:
iteratorin classRasCollection
-
size
public int size()Returns the number of elements in this Bag.- Specified by:
sizein interfaceCollection- Overrides:
sizein classRasCollection
-