ojb.odmg.collections
Class DSetImpl

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--ojb.odmg.collections.DSetImpl
All Implemented Interfaces:
java.util.Collection, DCollection, DSet, java.io.Serializable, java.util.Set

public class DSetImpl
extends java.util.AbstractSet
implements DSet, java.io.Serializable

Insert the type's description here. Creation date: (26.02.2001 13:05:03)

See Also:
Serialized Form

Constructor Summary
DSetImpl()
          DSetImpl constructor comment.
DSetImpl(int theId, int theSize)
          DListImpl constructor comment.
 
Method Summary
 boolean add(java.lang.Object o)
          Method declaration
 DSet difference(DSet otherSet)
          Create a new DSet object that contains the elements of this collection minus the elements in otherSet.
 boolean existsElement(java.lang.String predicate)
          Determines whether there is an element of the collection that evaluates to true for the predicate.
(package private)  java.util.Vector getElements()
          Insert the method's description here.
(package private)  int getId()
          Insert the method's description here.
 DSet intersection(DSet otherSet)
          Create a new DSet object that is the set intersection of this DSet object and the set referenced by otherSet.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this collection.
 boolean properSubsetOf(DSet otherSet)
          Determine whether this set is a proper subset of the set referenced by otherSet.
 boolean properSupersetOf(DSet otherSet)
          Determine whether this set is a proper superset of the set referenced by otherSet.
 DCollection query(java.lang.String predicate)
          Evaluate the boolean query predicate for each element of the collection and return a new collection that contains each element that evaluated to true.
 java.util.Iterator select(java.lang.String predicate)
          Access all of the elements of the collection that evaluate to true for the provided query predicate.
 java.lang.Object selectElement(java.lang.String predicate)
          Selects the single element of the collection for which the provided OQL query predicate is true.
(package private)  void setElements(java.util.Vector newElements)
          Insert the method's description here.
(package private)  void setId(int newId)
          Insert the method's description here.
 int size()
          Returns the number of elements in this collection.
 boolean subsetOf(DSet otherSet)
          Determine whether this set is a subset of the set referenced by otherSet.
 boolean supersetOf(DSet otherSet)
          Determine whether this set is a superset of the set referenced by otherSet.
 DSet union(DSet otherSet)
          Create a new DSet object that is the set union of this DSet object and the set referenced by otherSet.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface java.util.Set
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

DSetImpl

public DSetImpl()
DSetImpl constructor comment.


DSetImpl

public DSetImpl(int theId,
                int theSize)
DListImpl constructor comment.

Method Detail

add

public boolean add(java.lang.Object o)
Method declaration

Specified by:
add in interface java.util.Collection
Overrides:
add in class java.util.AbstractCollection
Parameters:
o -
Returns:

difference

public DSet difference(DSet otherSet)
Create a new DSet object that contains the elements of this collection minus the elements in otherSet.

Specified by:
difference in interface DSet
Parameters:
otherSet - A set containing elements that should not be in the result set.
Returns:
A newly created DSet instance that contains the elements of this set minus those elements in otherSet.

existsElement

public boolean existsElement(java.lang.String predicate)
                      throws QueryInvalidException
Determines whether there is an element of the collection that evaluates to true for the predicate.

Specified by:
existsElement in interface DCollection
Parameters:
predicate - An OQL boolean query predicate.
Returns:
True if there is an element of the collection that evaluates to true for the predicate, otherwise false.
Throws:
QueryInvalidException - The query predicate is invalid.

getElements

java.util.Vector getElements()
Insert the method's description here. Creation date: (26.02.2001 13:29:42)

Returns:
java.util.Vector

getId

int getId()
Insert the method's description here. Creation date: (26.02.2001 13:50:57)

Returns:
int

intersection

public DSet intersection(DSet otherSet)
Create a new DSet object that is the set intersection of this DSet object and the set referenced by otherSet.

Specified by:
intersection in interface DSet
Parameters:
otherSet - The other set to be used in the intersection operation.
Returns:
A newly created DSet instance that contains the intersection of the two sets.

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee).

Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in class java.util.AbstractCollection

properSubsetOf

public boolean properSubsetOf(DSet otherSet)
Determine whether this set is a proper subset of the set referenced by otherSet.

Specified by:
properSubsetOf in interface DSet
Parameters:
otherSet - Another set.
Returns:
True if this set is a proper subset of the set referenced by otherSet, otherwise false.

properSupersetOf

public boolean properSupersetOf(DSet otherSet)
Determine whether this set is a proper superset of the set referenced by otherSet.

Specified by:
properSupersetOf in interface DSet
Parameters:
otherSet - Another set.
Returns:
True if this set is a proper superset of the set referenced by otherSet, otherwise false.

query

public DCollection query(java.lang.String predicate)
                  throws QueryInvalidException
Evaluate the boolean query predicate for each element of the collection and return a new collection that contains each element that evaluated to true.

Specified by:
query in interface DCollection
Parameters:
predicate - An OQL boolean query predicate.
Returns:
A new collection containing the elements that evaluated true for the predicate.
Throws:
QueryInvalidException - The query predicate is invalid.

select

public java.util.Iterator select(java.lang.String predicate)
                          throws QueryInvalidException
Access all of the elements of the collection that evaluate to true for the provided query predicate.

Specified by:
select in interface DCollection
Parameters:
predicate - An OQL boolean query predicate.
Returns:
An iterator used to iterate over the elements that evaluated true for the predicate.
Throws:
QueryInvalidException - The query predicate is invalid.

selectElement

public java.lang.Object selectElement(java.lang.String predicate)
                               throws QueryInvalidException
Selects the single element of the collection for which the provided OQL query predicate is true.

Specified by:
selectElement in interface DCollection
Parameters:
predicate - An OQL boolean query predicate.
Returns:
The element that evaluates to true for the predicate. If no element evaluates to true, null is returned.
Throws:
QueryInvalidException - The query predicate is invalid.

setElements

void setElements(java.util.Vector newElements)
Insert the method's description here. Creation date: (26.02.2001 13:29:42)

Parameters:
newElements - java.util.Vector

setId

void setId(int newId)
Insert the method's description here. Creation date: (26.02.2001 13:50:57)

Parameters:
newId - int

size

public int size()
Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Specified by:
size in interface java.util.Collection
Specified by:
size in class java.util.AbstractCollection
Returns:
the number of elements in this collection

subsetOf

public boolean subsetOf(DSet otherSet)
Determine whether this set is a subset of the set referenced by otherSet.

Specified by:
subsetOf in interface DSet
Parameters:
otherSet - Another set.
Returns:
True if this set is a subset of the set referenced by otherSet, otherwise false.

supersetOf

public boolean supersetOf(DSet otherSet)
Determine whether this set is a superset of the set referenced by otherSet.

Specified by:
supersetOf in interface DSet
Parameters:
otherSet - Another set.
Returns:
True if this set is a superset of the set referenced by otherSet, otherwise false.

union

public DSet union(DSet otherSet)
Create a new DSet object that is the set union of this DSet object and the set referenced by otherSet.

Specified by:
union in interface DSet
Parameters:
otherSet - The other set to be used in the union operation.
Returns:
A newly created DSet instance that contains the union of the two sets.


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04