01: package org.odmg;
02:
03: /**
04: * The ODMG Set collection interface.
05: * A <code>DSet</code> object is an unordered collection that does not support
06: * multiple elements with the same value. An implementation typically is very
07: * efficient at determining whether the collection contains a particular value.
08: * <p>
09: * 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: public interface DSet extends DCollection, java.util.Set {
18:
19: /**
20: * Create a new <code>DSet</code> object that is the set union of this
21: * <code>DSet</code> object and the set referenced by <code>otherSet</code>.
22: * @param otherSet The other set to be used in the union operation.
23: * @return A newly created <code>DSet</code> instance that contains the union of the two sets.
24: */
25: public DSet union(DSet otherSet);
26:
27: /**
28: * Create a new <code>DSet</code> object that is the set intersection of this
29: * <code>DSet</code> object and the set referenced by <code>otherSet</code>.
30: * @param otherSet The other set to be used in the intersection operation.
31: * @return A newly created <code>DSet</code> instance that contains the
32: * intersection of the two sets.
33: */
34: public DSet intersection(DSet otherSet);
35:
36: /**
37: * Create a new <code>DSet</code> object that contains the elements of this
38: * collection minus the elements in <code>otherSet</code>.
39: * @param otherSet A set containing elements that should not be in the result set.
40: * @return A newly created <code>DSet</code> instance that contains the elements
41: * of this set minus those elements in <code>otherSet</code>.
42: */
43: public DSet difference(DSet otherSet);
44:
45: /**
46: * Determine whether this set is a subset of the set referenced by <code>otherSet</code>.
47: * @param otherSet Another set.
48: * @return True if this set is a subset of the set referenced by <code>otherSet</code>,
49: * otherwise false.
50: */
51: public boolean subsetOf(DSet otherSet);
52:
53: /**
54: * Determine whether this set is a proper subset of the set referenced by
55: * <code>otherSet</code>.
56: * @param otherSet Another set.
57: * @return True if this set is a proper subset of the set referenced by
58: * <code>otherSet</code>, otherwise false.
59: */
60: public boolean properSubsetOf(DSet otherSet);
61:
62: /**
63: * Determine whether this set is a superset of the set referenced by <code>otherSet</code>.
64: * @param otherSet Another set.
65: * @return True if this set is a superset of the set referenced by <code>otherSet</code>,
66: * otherwise false.
67: */
68: public boolean super setOf(DSet otherSet);
69:
70: /**
71: * Determine whether this set is a proper superset of the set referenced by
72: * <code>otherSet</code>.
73: * @param otherSet Another set.
74: * @return True if this set is a proper superset of the set referenced by
75: * <code>otherSet</code>, otherwise false.
76: */
77: public boolean properSupersetOf(DSet otherSet);
78: }
|