Source code: org/odmg/DSet.java
1 package org.odmg;
2
3 /**
4 * The ODMG Set collection interface.
5 * A <code>DSet</code> object is an unordered collection that does not support
6 * multiple elements with the same value. An implementation typically is very
7 * efficient at determining whether the collection contains a particular value.
8 * <p>
9 * All of the operations defined by the JavaSoft <code>Set</code>
10 * interface are supported by an ODMG implementation of <code>DSet</code>,
11 * the exception <code>UnsupportedOperationException</code> is not thrown when a
12 * call is made to any of the <code>Set</code> methods.
13 * @author David Jordan (as Java Editor of the Object Data Management Group)
14 * @version ODMG 3.0
15 */
16 // * @see java.lang.UnsupportedOperationException
17
18 public interface DSet extends DCollection, java.util.Set
19 {
20
21 /**
22 * Create a new <code>DSet</code> object that is the set union of this
23 * <code>DSet</code> object and the set referenced by <code>otherSet</code>.
24 * @param otherSet The other set to be used in the union operation.
25 * @return A newly created <code>DSet</code> instance that contains the union of the two sets.
26 */
27 public DSet union(DSet otherSet);
28
29 /**
30 * Create a new <code>DSet</code> object that is the set intersection of this
31 * <code>DSet</code> object and the set referenced by <code>otherSet</code>.
32 * @param otherSet The other set to be used in the intersection operation.
33 * @return A newly created <code>DSet</code> instance that contains the
34 * intersection of the two sets.
35 */
36 public DSet intersection(DSet otherSet);
37
38 /**
39 * Create a new <code>DSet</code> object that contains the elements of this
40 * collection minus the elements in <code>otherSet</code>.
41 * @param otherSet A set containing elements that should not be in the result set.
42 * @return A newly created <code>DSet</code> instance that contains the elements
43 * of this set minus those elements in <code>otherSet</code>.
44 */
45 public DSet difference(DSet otherSet);
46
47 /**
48 * Determine whether this set is a subset of the set referenced by <code>otherSet</code>.
49 * @param otherSet Another set.
50 * @return True if this set is a subset of the set referenced by <code>otherSet</code>,
51 * otherwise false.
52 */
53 public boolean subsetOf(DSet otherSet);
54
55 /**
56 * Determine whether this set is a proper subset of the set referenced by
57 * <code>otherSet</code>.
58 * @param otherSet Another set.
59 * @return True if this set is a proper subset of the set referenced by
60 * <code>otherSet</code>, otherwise false.
61 */
62 public boolean properSubsetOf(DSet otherSet);
63
64 /**
65 * Determine whether this set is a superset of the set referenced by <code>otherSet</code>.
66 * @param otherSet Another set.
67 * @return True if this set is a superset of the set referenced by <code>otherSet</code>,
68 * otherwise false.
69 */
70 public boolean supersetOf(DSet otherSet);
71
72 /**
73 * Determine whether this set is a proper superset of the set referenced by
74 * <code>otherSet</code>.
75 * @param otherSet Another set.
76 * @return True if this set is a proper superset of the set referenced by
77 * <code>otherSet</code>, otherwise false.
78 */
79 public boolean properSupersetOf(DSet otherSet);
80 }